Vanara.PInvoke.NetApi32 2.1.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Vanara.PInvoke.NetApi32 --version 2.1.0
                    
NuGet\Install-Package Vanara.PInvoke.NetApi32 -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vanara.PInvoke.NetApi32" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vanara.PInvoke.NetApi32" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Vanara.PInvoke.NetApi32" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Vanara.PInvoke.NetApi32 --version 2.1.0
                    
#r "nuget: Vanara.PInvoke.NetApi32, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Vanara.PInvoke.NetApi32@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Vanara.PInvoke.NetApi32&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Vanara.PInvoke.NetApi32&version=2.1.0
                    
Install as a Cake Tool

Methods, structures and constants imported from NetApi32.dll.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net20 is compatible.  net35 is compatible.  net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Vanara.PInvoke.NetApi32:

Package Downloads
Vanara.SystemServices

Classes for system related items derived from the Vanara PInvoke libraries. Includes extensions for Process (privileges and elavation), FileInfo (compression info), Shared Network Drives and Devices, and ServiceController (SetStartType) that pull extended information through native API calls.

Vanara.Library

The full set of packages associated with the Vanara PInvoke Libraries.

Miracatch.ActiveDirectory

Provides ActiveDirectory support to Miracatch.

Gerrie.Extensions.UncAccess

Simplifies mapping UNC shares with specific credentials into the application context for access. Usage: - Call AddUncAccessManager on your DI Collection during Startup. - Inject IUncAccessManager where needed - Call Login() overload with the path and credential you are using to access the UNC share. - Access the share using standard File IO. - Call Logout() when you have finished accessing the UNC Share. This library is based off of a stackoverflow post http://stackoverflow.com/questions/22940433/accessing-unc-shares-with-asp-net-application

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Vanara.PInvoke.NetApi32:

Repository Stars
zhuxb711/RX-Explorer
一款优雅的UWP文件管理器 | An elegant UWP Explorer
lithnet/access-manager
Access Manager provides web-based access to local admin (LAPS) passwords, BitLocker recovery keys, and just-in-time administrative access to Windows computers in a modern, secure, and user-friendly way.
Version Downloads Last Updated
4.2.1 262 9/9/2025
4.2.0 893 8/25/2025
4.1.6 3,790 6/20/2025
4.1.5 154 6/20/2025
4.1.4 620 6/7/2025
4.1.3 1,244 4/24/2025
4.1.2 405 4/16/2025
4.1.1 1,482 3/7/2025
4.1.0 317 3/7/2025
4.0.6 301 2/24/2025
4.0.5 476 2/8/2025
4.0.4 3,422 9/13/2024
4.0.3 413 8/5/2024
4.0.2 394 6/24/2024
4.0.1 1,198 4/30/2024
4.0.0 1,156 3/29/2024
4.0.0-beta2 269 1/22/2024
4.0.0-beta 251 11/20/2023
3.4.17 3,021 10/18/2023
3.4.16 769 8/7/2023
3.4.15 2,088 5/18/2023
3.4.14 583 4/15/2023
3.4.13 19,156 2/4/2023
3.4.12 888 1/15/2023
3.4.11 2,823 11/15/2022
3.4.10 1,228 10/25/2022
3.4.9 1,766 10/3/2022
3.4.8 1,294 9/16/2022
3.4.7 1,148 9/3/2022
3.4.6 1,213 8/7/2022
3.4.5 5,873 7/17/2022
3.4.4 1,653 7/5/2022
3.4.3 1,303 6/14/2022
3.4.2 2,815 5/13/2022
3.4.1 1,263 5/5/2022
3.4.0 1,923 3/14/2022
3.3.15 4,876 12/27/2021
3.3.14 1,087 10/26/2021
3.3.13 959 9/30/2021
3.3.12 1,141 8/30/2021
3.3.11 9,534 7/22/2021
3.3.10 1,027 6/4/2021
3.3.9 1,703 5/7/2021
3.3.8 1,002 4/7/2021
3.3.7 976 3/24/2021
3.3.6 962 3/19/2021
3.3.5 974 3/1/2021
3.3.4 927 2/11/2021
3.3.3 904 2/3/2021
3.3.2 910 1/21/2021
3.3.1 1,069 1/20/2021
3.3.0 1,613 11/20/2020
3.2.21 1,033 11/13/2020
3.2.20 3,934 11/8/2020
3.2.19 4,875 10/23/2020
3.2.18 1,069 10/21/2020
3.2.17 2,610 9/20/2020
3.2.16 1,511 9/7/2020
3.2.15 1,141 8/30/2020
3.2.14 1,062 8/20/2020
3.2.13 1,160 7/27/2020
3.2.12 1,057 7/13/2020
3.2.11 1,136 6/28/2020
3.2.10 1,184 6/14/2020
3.2.9 1,125 6/3/2020
3.2.7 1,153 5/4/2020
3.2.6 1,124 4/21/2020
3.2.5 1,144 4/15/2020
3.2.4 1,068 4/12/2020
3.2.3 1,085 4/1/2020
3.2.2 1,045 3/24/2020
3.2.1 1,101 3/17/2020
3.2.0 1,310 2/27/2020
3.1.9 1,149 1/17/2020
3.1.8 1,212 1/13/2020
3.1.7 1,153 1/6/2020
3.1.6 1,128 12/12/2019
3.1.5 1,288 11/26/2019
3.1.4 1,167 11/25/2019
3.1.3 1,333 11/8/2019
3.1.2 1,167 11/4/2019
3.1.1 1,284 10/17/2019
3.1.0 1,136 10/3/2019
3.0.1 1,197 9/20/2019
3.0.0 1,101 8/27/2019
2.3.11 1,220 6/9/2019
2.3.10 1,027 6/5/2019
2.3.9 1,071 5/26/2019
2.3.8 1,059 5/13/2019
2.3.7 1,094 4/24/2019
2.3.6 1,066 4/17/2019
2.3.5 1,032 4/10/2019
2.3.4 1,043 3/9/2019
2.3.3 1,028 3/8/2019
2.3.2 1,048 2/28/2019
2.3.1 1,037 2/25/2019
2.3.0 1,024 2/22/2019
2.2.1 845 2/12/2019
2.2.0 848 2/1/2019
2.1.2 1,210 1/14/2019
2.1.0 890 12/15/2018
2.0.1 905 12/7/2018
2.0.0 941 11/28/2018
1.1.0 1,063 9/10/2018
1.0.18 1,074 8/10/2018
1.0.17 1,116 7/30/2018
1.0.16 1,138 6/29/2018
1.0.15 1,329 6/27/2018
1.0.14 1,372 6/8/2018
1.0.13 1,315 6/6/2018
1.0.12 1,376 4/5/2018
1.0.11 1,415 4/4/2018
1.0.10 1,413 3/27/2018
1.0.9 1,377 3/26/2018
1.0.8 1,401 2/7/2018
1.0.7 1,384 1/27/2018
1.0.6 1,480 1/8/2018
1.0.5 1,467 12/28/2017
1.0.4 1,447 12/15/2017
1.0.3 1,212 12/8/2017
1.0.2 1,240 11/30/2017
1.0.1 1,245 11/28/2017

Currently implements:

Functions
DsAddressToSiteNamesA, DsAddressToSiteNamesExA, DsAddressToSiteNamesExW, DsAddressToSiteNamesW, DsDeregisterDnsHostRecordsA, DsDeregisterDnsHostRecordsW, DsEnumerateDomainTrustsA, DsEnumerateDomainTrustsW, DsGetDcCloseW, DsGetDcNameA, DsGetDcNameW, DsGetDcNextA, DsGetDcNextW, DsGetDcOpenA, DsGetDcOpenW, DsGetDcSiteCoverageA, DsGetDcSiteCoverageW, DsGetForestTrustInformationW, DsGetSiteNameA, DsGetSiteNameW, DsMergeForestTrustInformationW, DsRoleFreeMemory, DsRoleGetPrimaryDomainInformation, DsValidateSubnetNameA, DsValidateSubnetNameW, NetApiBufferFree, NetServerComputerNameAdd, NetServerComputerNameDel, NetServerDiskEnum, NetServerEnum, NetServerGetInfo, NetServerSetInfo, NetServerTransportAdd, NetServerTransportAddEx, NetServerTransportDel, NetServerTransportEnum

Structures
DOMAIN_CONTROLLER_INFO, DS_DOMAIN_TRUSTS, DSROLE_OPERATION_STATE_INFO, DSROLE_PRIMARY_DOMAIN_INFO_BASIC, DSROLE_UPGRADE_STATUS_INFO, SERVER_INFO_100, SERVER_INFO_101, SERVER_INFO_102, SERVER_INFO_402, SERVER_INFO_403, SERVER_TRANSPORT_INFO_0, SERVER_TRANSPORT_INFO_1, SERVER_TRANSPORT_INFO_2, SERVER_TRANSPORT_INFO_3