# README

Code-generated P/Invoke signatures.

Considering throwing a [donation](https://ko-fi.com/rasta_mouse) if you find this useful.


# AdjustTokenGroups

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL AdjustTokenGroups(
    HANDLE TokenHandle,
    BOOL ResetToDefault,
    [Optional] TOKEN_GROUPS* NewState,
    uint BufferLength,
    [Optional] TOKEN_GROUPS* PreviousState,
    [Optional] uint* ReturnLength);
```


# AdjustTokenPrivileges

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL AdjustTokenPrivileges(
    HANDLE TokenHandle,
    BOOL DisableAllPrivileges,
    [Optional] TOKEN_PRIVILEGES* NewState,
    uint BufferLength,
    [Optional] TOKEN_PRIVILEGES* PreviousState,
    [Optional] uint* ReturnLength);
```

[TOKEN\_PRIVILEGES](/security/token_privileges)


# ChangeServiceConfigW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL ChangeServiceConfigW(
    SC_HANDLE hService,
    ENUM_SERVICE_TYPE dwServiceType,
    SERVICE_START_TYPE dwStartType,
    SERVICE_ERROR dwErrorControl,
    PCWSTR lpBinaryPathName,
    PCWSTR lpLoadOrderGroup,
    [Optional] uint* lpdwTagId,
    PCWSTR lpDependencies,
    PCWSTR lpServiceStartName,
    PCWSTR lpPassword,
    PCWSTR lpDisplayName);
```

[SC\_HANDLE](/security/sc_handle)

[ENUM\_SERVICE\_TYPE](/services/enum_service_type)

[SERVICE\_START\_TYPE](/services/service_start_type)

[SERVICE\_ERROR](/services/service_error)


# CloseServiceHandle

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL CloseServiceHandle(SC_HANDLE hSCObject);
```


# ControlService

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL ControlService(
    SC_HANDLE hService,
    uint dwControl,
    SERVICE_STATUS* lpServiceStatus);
```

[SERVICE\_STATUS](/services/service_status)


# CreateProcessAsUserW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreateProcessAsUserW(
    HANDLE hToken,
    PCWSTR lpApplicationName,
    PWSTR lpCommandLine,
    [Optional] SECURITY_ATTRIBUTES* lpProcessAttributes,
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    BOOL bInheritHandles,
    PROCESS_CREATION_FLAGS dwCreationFlags,
    [Optional] void* lpEnvironment,
    PCWSTR lpCurrentDirectory,
    STARTUPINFOW* lpStartupInfo,
    PROCESS_INFORMATION* lpProcessInformation);
```

[SECURITY\_ATTRIBUTES](/security/security_attributes)

[PROCESS\_CREATION\_FLAGS](/threading/process_creation_flags)

[STARTUPINFOW](/threading/startupinfow)

[PROCESS\_INFORMATION](/threading/process_information)


# CreateProcessWithTokenW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreateProcessWithTokenW(
    HANDLE hToken,
    CREATE_PROCESS_LOGON_FLAGS dwLogonFlags,
    PCWSTR lpApplicationName,
    PWSTR lpCommandLine,
    PROCESS_CREATION_FLAGS dwCreationFlags,
    [Optional] void* lpEnvironment,
    PCWSTR lpCurrentDirectory,
    STARTUPINFOW* lpStartupInfo,
    PROCESS_INFORMATION* lpProcessInformation);
```

[CREATE\_PROCESS\_LOGON\_FLAGS](/threading/create_process_logon_flags)

[PROCESS\_CREATION\_FLAGS](/threading/process_creation_flags)

[STARTUPINFOW](/threading/startupinfow)

[PROCESS\_INFORMATION](/threading/process_information)


# CreateServiceW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe SC_HANDLE CreateServiceW(
    SC_HANDLE hSCManager,
    PCWSTR lpServiceName,
    PCWSTR lpDisplayName,
    uint dwDesiredAccess,
    ENUM_SERVICE_TYPE dwServiceType,
    SERVICE_START_TYPE dwStartType,
    SERVICE_ERROR dwErrorControl,
    PCWSTR lpBinaryPathName,
    PCWSTR lpLoadOrderGroup,
    [Optional] uint* lpdwTagId,
    PCWSTR lpDependencies,
    PCWSTR lpServiceStartName,
    PCWSTR lpPassword);
```

[ENUM\_SERVICE\_TYPE](/services/enum_service_type)

[SERVICE\_START\_TYPE](/services/service_start_type)

[SERVICE\_ERROR](/services/service_error)


# CryptDecrypt

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CryptDecrypt(
    nuint hKey,
    nuint hHash,
    BOOL Final,
    uint dwFlags,
    byte* pbData,
    uint* pdwDataLen);
```


# CryptEncrypt

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CryptEncrypt(
    nuint hKey,
    nuint hHash,
    BOOL Final,
    uint dwFlags,
    [Optional] byte* pbData,
    uint* pdwDataLen,
    uint dwBufLen);
```


# DeleteService

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL DeleteService(SC_HANDLE hService);
```


# DuplicateTokenEx

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL DuplicateTokenEx(
    HANDLE hExistingToken,
    TOKEN_ACCESS_MASK dwDesiredAccess,
    [Optional] SECURITY_ATTRIBUTES* lpTokenAttributes,
    SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
    TOKEN_TYPE TokenType,
    HANDLE* phNewToken);
```

[TOKEN\_ACCESS\_MASK](/security/token_access_mask)

[SECURITY\_IMPERSONATION\_LEVEL](/security/security_impersonation_level)

[TOKEN\_TYPE](/security/token_type)


# GetTokenInformation

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL GetTokenInformation(
    HANDLE TokenHandle,
    TOKEN_INFORMATION_CLASS TokenInformationClass,
    [Optional] void* TokenInformation,
    uint TokenInformationLength,
    uint* ReturnLength);
```

[TOKEN\_INFORMATION\_CLASS](/security/token_information_class)


# ImpersonateLoggedOnUser

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL ImpersonateLoggedOnUser(HANDLE hToken);
```


# ImpersonateNamedPipeClient

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL ImpersonateNamedPipeClient(HANDLE hNamedPipe);
```


# LogonUserW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LogonUserW(
    PCWSTR lpszUsername,
    PCWSTR lpszDomain,
    PCWSTR lpszPassword,
    LOGON32_LOGON dwLogonType,
    LOGON32_PROVIDER dwLogonProvider,
    HANDLE* phToken);
```

[LOGON32\_LOGON](/security/logon32_logon)

[LOGON32\_PROVIDER](/security/logon32_provider)


# OpenProcessToken

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL OpenProcessToken(
    HANDLE ProcessHandle,
    TOKEN_ACCESS_MASK DesiredAccess,
    HANDLE* TokenHandle);
```

[TOKEN\_ACCESS\_MASK](/security/token_access_mask)


# OpenSCManagerW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern SC_HANDLE OpenSCManagerW(
    PCWSTR lpMachineName,
    PCWSTR lpDatabaseName,
    uint dwDesiredAccess);
```


# OpenServiceW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern SC_HANDLE OpenServiceW(
    SC_HANDLE hSCManager,
    PCWSTR lpServiceName,
    uint dwDesiredAccess);
```


# OpenThreadToken

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL OpenThreadToken(
    HANDLE ThreadHandle,
    TOKEN_ACCESS_MASK DesiredAccess,
    BOOL OpenAsSelf,
    HANDLE* TokenHandle);
```

[TOKEN\_ACCESS\_MASK](/security/token_access_mask)


# RtlDecryptMemory

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe NTSTATUS RtlDecryptMemory(
    void* Memory,
    uint MemorySize,
    uint OptionFlags);
```


# RtlEncryptMemory

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe NTSTATUS RtlEncryptMemory(
    void* Memory,
    uint MemorySize,
    uint OptionFlags);
```


# SetTokenInformation

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL SetTokenInformation(
    HANDLE TokenHandle,
    TOKEN_INFORMATION_CLASS TokenInformationClass,
    void* TokenInformation,
    uint TokenInformationLength);
```

[TOKEN\_INFORMATION\_CLASS](/security/token_information_class)


# StartServiceW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL StartServiceW(
    SC_HANDLE hService,
    uint dwNumServiceArgs,
    [Optional] PCWSTR* lpServiceArgVectors);
```


# LsaNtStatusToWinError

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern uint LsaNtStatusToWinError(NTSTATUS Status);
```


# GetSidSubAuthorityCount

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe byte* GetSidSubAuthorityCount(PSID pSid);
```

[PSID](/foundation/psid)


# GetSidSubAuthority

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe uint* GetSidSubAuthority(
    PSID pSid,
    uint nSubAuthority);
```

[PSID](/foundation/psid)


# CreateProcessWithLogonW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreateProcessWithLogonW(
    PCWSTR lpUsername,
    PCWSTR lpDomain,
    PCWSTR lpPassword,
    CREATE_PROCESS_LOGON_FLAGS dwLogonFlags,
    PCWSTR lpApplicationName,
    PWSTR lpCommandLine,
    PROCESS_CREATION_FLAGS dwCreationFlags,
    [Optional] void* lpEnvironment,
    PCWSTR lpCurrentDirectory,
    STARTUPINFOW* lpStartupInfo,
    PROCESS_INFORMATION* lpProcessInformation);
```

[CREATE\_PROCESS\_LOGON\_FLAGS](/threading/create_process_logon_flags)

[PROCESS\_CREATION\_FLAGS](/threading/process_creation_flags)

[STARTUPINFOW](/threading/startupinfow)

[PROCESS\_INFORMATION](/threading/process_information)


# ChangeServiceConfigA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL ChangeServiceConfigA(
    SC_HANDLE hService,
    ENUM_SERVICE_TYPE dwServiceType,
    SERVICE_START_TYPE dwStartType,
    SERVICE_ERROR dwErrorControl,
    PCSTR lpBinaryPathName,
    PCSTR lpLoadOrderGroup,
    [Optional] uint* lpdwTagId,
    PCSTR lpDependencies,
    PCSTR lpServiceStartName,
    PCSTR lpPassword,
    PCSTR lpDisplayName);
```

[SC\_HANDLE](/security/sc_handle)

[ENUM\_SERVICE\_TYPE](/services/enum_service_type)

[SERVICE\_START\_TYPE](/services/service_start_type)

[SERVICE\_ERROR](/services/service_error)


# CreateProcessAsUserA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreateProcessAsUserA(
    HANDLE hToken,
    PCSTR lpApplicationName,
    PSTR lpCommandLine,
    [Optional] SECURITY_ATTRIBUTES* lpProcessAttributes,
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    BOOL bInheritHandles,
    PROCESS_CREATION_FLAGS dwCreationFlags,
    [Optional] void* lpEnvironment,
    PCSTR lpCurrentDirectory,
    STARTUPINFOA* lpStartupInfo,
    PROCESS_INFORMATION* lpProcessInformation);
```

[SECURITY\_ATTRIBUTES](/security/security_attributes)

[PROCESS\_CREATION\_FLAGS](/threading/process_creation_flags)

[STARTUPINFOA](/threading/startupinfoa)


# CreateServiceA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe SC_HANDLE CreateServiceA(
    SC_HANDLE hSCManager,
    PCSTR lpServiceName,
    PCSTR lpDisplayName,
    uint dwDesiredAccess,
    ENUM_SERVICE_TYPE dwServiceType,
    SERVICE_START_TYPE dwStartType,
    SERVICE_ERROR dwErrorControl,
    PCSTR lpBinaryPathName,
    PCSTR lpLoadOrderGroup,
    [Optional] uint* lpdwTagId,
    PCSTR lpDependencies,
    PCSTR lpServiceStartName,
    PCSTR lpPassword);
```

[ENUM\_SERVICE\_TYPE](/services/enum_service_type)

[SERVICE\_START\_TYPE](/services/service_start_type)

[SERVICE\_ERROR](/services/service_error)


# LogonUserA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LogonUserA(
    PCSTR lpszUsername,
    PCSTR lpszDomain,
    PCSTR lpszPassword,
    LOGON32_LOGON dwLogonType,
    LOGON32_PROVIDER dwLogonProvider,
    HANDLE* phToken);
```

[LOGON32\_LOGON](/security/logon32_logon)

[LOGON32\_PROVIDER](/security/logon32_provider)


# LogonUserExW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LogonUserExW(
    PCWSTR lpszUsername,
    PCWSTR lpszDomain,
    PCWSTR lpszPassword,
    LOGON32_LOGON dwLogonType,
    LOGON32_PROVIDER dwLogonProvider,
    [Optional] HANDLE* phToken,
    [Optional] PSID* ppLogonSid,
    [Optional] void** ppProfileBuffer,
    [Optional] uint* pdwProfileLength,
    [Optional] QUOTA_LIMITS* pQuotaLimits);
```

[LOGON32\_LOGON](/security/logon32_logon)

[LOGON32\_PROVIDER](/security/logon32_provider)

[QUOTA\_LIMITS](/security/quota_limits)


# LogonUserExA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LogonUserExA(
    PCSTR lpszUsername,
    PCSTR lpszDomain,
    PCSTR lpszPassword,
    LOGON32_LOGON dwLogonType,
    LOGON32_PROVIDER dwLogonProvider,
    [Optional] HANDLE* phToken,
    [Optional] PSID* ppLogonSid,
    [Optional] void** ppProfileBuffer,
    [Optional] uint* pdwProfileLength,
    [Optional] QUOTA_LIMITS* pQuotaLimits);
```

[LOGON32\_LOGON](/security/logon32_logon)

[LOGON32\_PROVIDER](/security/logon32_provider)

[QUOTA\_LIMITS](/security/quota_limits)


# LookupAccountSidW

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL LookupAccountSidW(
    PCWSTR lpSystemName,
    PSID Sid,
    PWSTR Name,
    uint* cchName,
    PWSTR ReferencedDomainName,
    uint* cchReferencedDomainName,
    SID_NAME_USE* peUse);
```

{% content-ref url="/pages/W118Dn5hOYywNnAfun7u" %}
[SID\_NAME\_USE](/security/sid_name_use)
{% endcontent-ref %}


# OpenSCManagerA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern SC_HANDLE OpenSCManagerA(
    PCSTR lpMachineName,
    PCSTR lpDatabaseName,
    uint dwDesiredAccess);
```


# OpenServiceA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern SC_HANDLE OpenServiceA(
    SC_HANDLE hSCManager,
    PCSTR lpServiceName,
    uint dwDesiredAccess);
```


# StartServiceA

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL StartServiceA(
    SC_HANDLE hService,
    uint dwNumServiceArgs,
    [Optional] PCSTR* lpServiceArgVectors);
```


# LsaEnumerateTrustedDomains

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe NTSTATUS LsaEnumerateTrustedDomains(
    LSA_HANDLE PolicyHandle,
    uint* EnumerationContext,
    void** Buffer,
    uint PreferedMaximumLength,
    uint* CountReturned);
```

[NTSTATUS](/foundation/ntstatus)

[LSA\_HANDLE](/authentication/lsa_handle)


# LsaClose

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern NTSTATUS LsaClose(LSA_HANDLE ObjectHandle);
```

[NTSTATUS](/foundation/ntstatus)

[LSA\_HANDLE](/authentication/lsa_handle)


# LsaQueryDomainInformationPolicy

```csharp
[DllImport("ADVAPI32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe NTSTATUS LsaQueryDomainInformationPolicy(
    LSA_HANDLE PolicyHandle,
    POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
    void** Buffer);
```

[NTSTATUS](/foundation/ntstatus)

[LSA\_HANDLE](/authentication/lsa_handle)

[POLICY\_DOMAIN\_INFORMATION\_CLASS](/authentication/policy_domain_information_class)


# CloseHandle

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL CloseHandle(HANDLE hObject);
```


# ConnectNamedPipe

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL ConnectNamedPipe(
    HANDLE hNamedPipe,
    [Optional] NativeOverlapped* lpOverlapped);
```


# ConvertFiberToThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL ConvertFiberToThread();
```


# ConvertThreadToFiber

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void* ConvertThreadToFiber([Optional] void* lpParameter);
```


# CreateFiber

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void* CreateFiber(
    nuint dwStackSize,
    LPFIBER_START_ROUTINE lpStartAddress,
    [Optional] void* lpParameter);
```

[LPFIBER\_START\_ROUTINE](/threading/lpfiber_start_routine)


# CreateFileW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateFileW(
    PCWSTR lpFileName,
    uint dwDesiredAccess,
    FILE_SHARE_MODE dwShareMode,
    [Optional] SECURITY_ATTRIBUTES* lpSecurityAttributes,
    FILE_CREATION_DISPOSITION dwCreationDisposition,
    FILE_FLAGS_AND_ATTRIBUTES dwFlagsAndAttributes,
    HANDLE hTemplateFile);
```

[FILE\_SHARE\_MODE](/filesystem/file_share_mode)

[FILE\_CREATION\_DISPOSITION](/filesystem/file_creation_disposition)

[FILE\_FLAGS\_AND\_ATTRIBUTES](/filesystem/file_flags_and_attributes)


# CreateMailslotW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateMailslotW(
    PCWSTR lpName,
    uint nMaxMessageSize,
    uint lReadTimeout,
    [Optional] SECURITY_ATTRIBUTES* lpSecurityAttributes);
```


# CreateNamedPipeW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateNamedPipeW(
    PCWSTR lpName,
    FILE_FLAGS_AND_ATTRIBUTES dwOpenMode,
    NAMED_PIPE_MODE dwPipeMode,
    uint nMaxInstances,
    uint nOutBufferSize,
    uint nInBufferSize,
    uint nDefaultTimeOut,
    [Optional] SECURITY_ATTRIBUTES* lpSecurityAttributes);
```

[FILE\_FLAGS\_AND\_ATTRIBUTES](/filesystem/file_flags_and_attributes)

[NAMED\_PIPE\_MODE](/pipes/named_pipe_mode)

[SECURITY\_ATTRIBUTES](/security/security_attributes)


# CreatePipe

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreatePipe(
    HANDLE* hReadPipe,
    HANDLE* hWritePipe,
    [Optional] SECURITY_ATTRIBUTES* lpPipeAttributes,
    uint nSize);
```


# CreateProcessW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreateProcessW(
    PCWSTR lpApplicationName,
    PWSTR lpCommandLine,
    [Optional] SECURITY_ATTRIBUTES* lpProcessAttributes,
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    BOOL bInheritHandles,
    PROCESS_CREATION_FLAGS dwCreationFlags,
    [Optional] void* lpEnvironment,
    PCWSTR lpCurrentDirectory,
    STARTUPINFOW* lpStartupInfo,
    PROCESS_INFORMATION* lpProcessInformation);
```

[SECURITY\_ATTRIBUTES](/security/security_attributes)

[PROCESS\_CREATION\_FLAGS](/threading/process_creation_flags)

[STARTUPINFOW](/threading/startupinfow)

[PROCESS\_INFORMATION](/threading/process_information)


# CreateRemoteThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateRemoteThread(
    HANDLE hProcess,
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    nuint dwStackSize,
    LPTHREAD_START_ROUTINE lpStartAddress,
    [Optional] void* lpParameter,
    THREAD_CREATION_FLAGS dwCreationFlags,
    [Optional] uint* lpThreadId);
```

[LPTHREAD\_START\_ROUTINE](/threading/lpthread_start_routine)

[THREAD\_CREATION\_FLAGS](/threading/thread_creation_flags)


# CreateThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateThread(
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    nuint dwStackSize,
    LPTHREAD_START_ROUTINE lpStartAddress,
    [Optional] void* lpParameter,
    THREAD_CREATION_FLAGS dwCreationFlags,
    [Optional] uint* lpThreadId);
```

[LPTHREAD\_START\_ROUTINE](/threading/lpthread_start_routine)

[THREAD\_CREATION\_FLAGS](/threading/thread_creation_flags)


# DeleteFiber

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void DeleteFiber(void* lpFiber);
```


# DeleteProcThreadAttributeList

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern void DeleteProcThreadAttributeList(LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList);
```

[LPPROC\_THREAD\_ATTRIBUTE\_LIST](/threading/lpproc_thread_attribute_list)


# DeviceIoControl

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL DeviceIoControl(
    HANDLE hDevice,
    uint dwIoControlCode,
    [Optional] void* lpInBuffer,
    uint nInBufferSize,
    [Optional] void* lpOutBuffer,
    uint nOutBufferSize,
    [Optional] uint* lpBytesReturned,
    [Optional] NativeOverlapped* lpOverlapped);
```


# DisconnectNamedPipe

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL DisconnectNamedPipe(HANDLE hNamedPipe);
```


# DuplicateHandle

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL DuplicateHandle(
    HANDLE hSourceProcessHandle,
    HANDLE hSourceHandle,
    HANDLE hTargetProcessHandle,
    HANDLE* lpTargetHandle,
    uint dwDesiredAccess,
    BOOL bInheritHandle,
    DUPLICATE_HANDLE_OPTIONS dwOptions);
```

[DUPLICATE\_HANDLE\_OPTIONS](/foundation/duplicate_handle_options)


# FlushInstructionCache

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL FlushInstructionCache(
    HANDLE hProcess,
    [Optional] void* lpBaseAddress,
    nuint dwSize);
```


# FreeLibrary

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern BOOL FreeLibrary(HMODULE hLibModule);
```


# GetCurrentProcess

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HANDLE GetCurrentProcess();
```


# GetCurrentProcessId

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern uint GetCurrentProcessId();
```


# GetCurrentThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HANDLE GetCurrentThread();
```


# GetCurrentThreadId

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern uint GetCurrentThreadId();
```


# GetModuleHandleW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HMODULE GetModuleHandleW(PCWSTR lpModuleName);
```


# GetProcAddress

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern FARPROC GetProcAddress(
    HMODULE hModule,
    PCSTR lpProcName);
```


# GetProcessHeap

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HANDLE GetProcessHeap();
```


# GetStdHandle

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HANDLE GetStdHandle(STD_HANDLE nStdHandle);
```

[STD\_HANDLE](/console/std_handle)


# GetThreadContext

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL GetThreadContext(
    HANDLE hThread,
    CONTEXT* lpContext);
```

[CONTEXT](/debug/context)


# GetThreadInformation

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL GetThreadInformation(
    HANDLE hThread,
    THREAD_INFORMATION_CLASS ThreadInformationClass,
    void* ThreadInformation,
    uint ThreadInformationSize);
```

[THREAD\_INFORMATION\_CLASS](/foundation/thread_information_class)


# HeapAlloc

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void* HeapAlloc(
    HANDLE hHeap,
    HEAP_FLAGS dwFlags,
    nuint dwBytes);
```

[HEAP\_FLAGS](/memory/heap_flags)


# HeapFree

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL HeapFree(
    HANDLE hHeap,
    HEAP_FLAGS dwFlags,
    [Optional] void* lpMem);
```

[HEAP\_FLAGS](/memory/heap_flags)


# InitializeProcThreadAttributeList

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL InitializeProcThreadAttributeList(
    LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
    uint dwAttributeCount,
    uint dwFlags,
    nuint* lpSize);
```

[LPPROC\_THREAD\_ATTRIBUTE\_LIST](/threading/lpproc_thread_attribute_list)


# IsWow64Process

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL IsWow64Process(
    HANDLE hProcess,
    BOOL* Wow64Process);
```


# LoadLibraryW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HMODULE LoadLibraryW(PCWSTR lpLibFileName);
```


# LoadLibraryExW

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HMODULE LoadLibraryExW(
    PCWSTR lpLibFileName,
    HANDLE hFile,
    LOAD_LIBRARY_FLAGS dwFlags);
```

[LOAD\_LIBRARY\_FLAGS](/library-loader/load_library_flags)


# LocalAlloc

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HLOCAL LocalAlloc(
    LOCAL_ALLOC_FLAGS uFlags,
    nuint uBytes);
```

[LOCAL\_ALLOC\_FLAGS](/memory/local_alloc_flags)


# LocalFree

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HLOCAL LocalFree(HLOCAL hMem);
```


# OpenProcess

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HANDLE OpenProcess(
    PROCESS_ACCESS_RIGHTS dwDesiredAccess, 
    BOOL bInheritHandle,
    uint dwProcessId);
```

[PROCESS\_ACCESS\_RIGHTS](/threading/process_access_rights)


# PeekNamedPipe

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL PeekNamedPipe(
    HANDLE hNamedPipe,
    [Optional] void* lpBuffer,
    uint nBufferSize,
    [Optional] uint* lpBytesRead,
    [Optional] uint* lpTotalBytesAvail,
    [Optional] uint* lpBytesLeftThisMessage);
```


# QueueUserAPC

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern uint QueueUserAPC(
    PAPCFUNC pfnAPC,
    HANDLE hThread,
    nuint dwData);
```

[PAPCFUNC](/foundation/papcfunc)


# ReadProcessMemory

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL ReadProcessMemory(
    HANDLE hProcess,
    void* lpBaseAddress,
    void* lpBuffer,
    nuint nSize,
    [Optional] nuint* lpNumberOfBytesRead);
```


# ResumeThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern uint ResumeThread(HANDLE hThread);
```


# SetThreadContext

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL SetThreadContext(
    HANDLE hThread,
    CONTEXT* lpContext);
```

[CONTEXT](/debug/context)


# SuspendThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern uint SuspendThread(HANDLE hThread);
```


# SwitchToFiber

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void SwitchToFiber(void* lpFiber);
```


# UpdateProcThreadAttribute

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL UpdateProcThreadAttribute(
    LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
    uint dwFlags,
    nuint Attribute,
    [Optional] void* lpValue,
    nuint cbSize,
    [Optional] void* lpPreviousValue,
    [Optional] nuint* lpReturnSize);
```

[LPPROC\_THREAD\_ATTRIBUTE\_LIST](/threading/lpproc_thread_attribute_list)

[PROC\_THREAD\_ATTRIBUTE](/threading/proc_thread_attribute)

[PROCESS\_CREATION\_MITIGATION\_POLICY](/threading/process_creation_mitigation_policy)


# VirtualAlloc

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void* VirtualAlloc(
    [Optional] void* lpAddress,
    nuint dwSize,
    VIRTUAL_ALLOCATION_TYPE flAllocationType,
    PAGE_PROTECTION_FLAGS flProtect);
```

[VIRTUAL\_ALLOCATION\_TYPE](/memory/virtual_allocation_type)

[PAGE\_PROTECTION\_FLAGS](/memory/page_protection_flags)


# VirtualAllocEx

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe void* VirtualAllocEx(
    HANDLE hProcess,
    [Optional] void* lpAddress,
    nuint dwSize,
    VIRTUAL_ALLOCATION_TYPE flAllocationType,
    PAGE_PROTECTION_FLAGS flProtect);
```

[VIRTUAL\_ALLOCATION\_TYPE](/memory/virtual_allocation_type)

[PAGE\_PROTECTION\_FLAGS](/memory/page_protection_flags)


# VirtualFree

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL VirtualFree(
    void* lpAddress,
    nuint dwSize,
    VIRTUAL_FREE_TYPE dwFreeType);
```

[VIRTUAL\_FREE\_TYPE](/memory/virtual_free_type)


# VirtualFreeEx

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL VirtualFreeEx(
    HANDLE hProcess,
    void* lpAddress,
    nuint dwSize,
    VIRTUAL_FREE_TYPE dwFreeType);
```

[VIRTUAL\_FREE\_TYPE](/memory/virtual_free_type)


# VirtualProtect

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL VirtualProtect(
    void* lpAddress,
    nuint dwSize,
    PAGE_PROTECTION_FLAGS flNewProtect,
    PAGE_PROTECTION_FLAGS* lpflOldProtect);
```

[PAGE\_PROTECTION\_FLAGS](/memory/page_protection_flags)


# VirtualProtectEx

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL VirtualProtectEx(
    HANDLE hProcess,
    void* lpAddress,
    nuint dwSize,
    PAGE_PROTECTION_FLAGS flNewProtect,
    PAGE_PROTECTION_FLAGS* lpflOldProtect);
```

[PAGE\_PROTECTION\_FLAGS](/memory/page_protection_flags)


# WriteProcessMemory

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL WriteProcessMemory(
    HANDLE hProcess,
    void* lpBaseAddress,
    void* lpBuffer,
    nuint nSize,
    [Optional] nuint* lpNumberOfBytesWritten);
```


# CreateFileA

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateFileA(
    PCSTR lpFileName,
    uint dwDesiredAccess,
    FILE_SHARE_MODE dwShareMode,
    [Optional] SECURITY_ATTRIBUTES* lpSecurityAttributes,
    FILE_CREATION_DISPOSITION dwCreationDisposition,
    FILE_FLAGS_AND_ATTRIBUTES dwFlagsAndAttributes,
    HANDLE hTemplateFile);
```

[FILE\_SHARE\_MODE](/filesystem/file_share_mode)

[FILE\_CREATION\_DISPOSITION](/filesystem/file_creation_disposition)

[FILE\_FLAGS\_AND\_ATTRIBUTES](/filesystem/file_flags_and_attributes)


# CreateMailslotA

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateMailslotA(
    PCSTR lpName,
    uint nMaxMessageSize,
    uint lReadTimeout,
    [Optional] SECURITY_ATTRIBUTES* lpSecurityAttributes);
```

[SECURITY\_ATTRIBUTES](/security/security_attributes)


# CreateNamedPipeA

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateNamedPipeA(
    PCSTR lpName,
    FILE_FLAGS_AND_ATTRIBUTES dwOpenMode,
    NAMED_PIPE_MODE dwPipeMode,
    uint nMaxInstances,
    uint nOutBufferSize,
    uint nInBufferSize,
    uint nDefaultTimeOut,
    [Optional] SECURITY_ATTRIBUTES* lpSecurityAttributes);
```

[FILE\_FLAGS\_AND\_ATTRIBUTES](/filesystem/file_flags_and_attributes)

[NAMED\_PIPE\_MODE](/pipes/named_pipe_mode)

[SECURITY\_ATTRIBUTES](/security/security_attributes)


# CreateProcessA

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL CreateProcessA(
    PCSTR lpApplicationName,
    PSTR lpCommandLine,
    [Optional] SECURITY_ATTRIBUTES* lpProcessAttributes,
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    BOOL bInheritHandles,
    PROCESS_CREATION_FLAGS dwCreationFlags,
    [Optional] void* lpEnvironment,
    PCSTR lpCurrentDirectory,
    STARTUPINFOA* lpStartupInfo,
    PROCESS_INFORMATION* lpProcessInformation);
```

[SECURITY\_ATTRIBUTES](/security/security_attributes)

[PROCESS\_CREATION\_FLAGS](/threading/process_creation_flags)

[STARTUPINFOA](/threading/startupinfoa)

[PROCESS\_INFORMATION](/threading/process_information)


# GetModuleHandleA

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HMODULE GetModuleHandleA(PCSTR lpModuleName);
```




---

[Next Page](/llms-full.txt/1)

