C# Class GSF.Interop.WindowsApi

Show file Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
GetErrorMessage ( int errorCode ) : string

Formats and returns a .NET string containing the Windows API level error message corresponding to the specified error code.

GetLastErrorMessage ( ) : string

Formats and returns a .NET string containing the Windows API level error message from the last Win32 call.

Private Methods

Method Description
AdjustTokenPrivileges ( IntPtr TokenHandle, bool DisableAllPrivileges, [ NewState, int BufferLength, IntPtr PreviousState, int &ReturnLength ) : bool
ChangeServiceConfig2 ( IntPtr hService, int dwInfoLevel, IntPtr lpInfo ) : bool
ChangeServiceConfig2 ( IntPtr hService, int dwInfoLevel, [ lpInfo ) : bool
CloseHandle ( IntPtr hndl ) : bool
CloseServiceHandle ( IntPtr hSCObject ) : bool
CopyMemory ( IntPtr destination, IntPtr source, uint length ) : void
CreateProcessWithTokenW ( IntPtr hToken, LogonFlags dwLogonFlags, string lpApplicationName, string lpCommandLine, CreationFlags dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [ lpStartupInfo, PROCESS_INFORMATION &lpProcessInformation ) : bool
CryptFindOIDInfo ( int dwKeyType, string pvKey, uint dwGroupId ) : IntPtr
CryptRegisterOIDInfo ( IntPtr pInfo, int dwFlags ) : bool
CryptUnregisterOIDInfo ( IntPtr pInfo ) : bool
DuplicateToken ( IntPtr existingTokenHandle, int securityImpersonationLevel, IntPtr &duplicateTokenHandle ) : bool
DuplicateTokenEx ( IntPtr hExistingToken, uint dwDesiredAccess, IntPtr lpTokenAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, IntPtr &phNewToken ) : bool
DuplicateTokenEx ( IntPtr hExistingToken, uint dwDesiredAccess, [ lpTokenAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, IntPtr &phNewToken ) : bool
FlushFileBuffers ( SafeFileHandle handle ) : void
FormatMessage ( int dwFlags, IntPtr &lpSource, int dwMessageId, int dwLanguageId, string &lpBuffer, int nSize, IntPtr &Arguments ) : int
FreeSid ( IntPtr pSid ) : IntPtr
GetCurrentProcess ( ) : IntPtr
GetLastError ( ) : int
GetShellWindow ( ) : IntPtr
GetTokenInformation ( IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, TOKEN_ELEVATION_TYPE &TokenInformation, uint TokenInformationLength, uint &ReturnLength ) : bool
GetTokenInformation ( IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, uint &TokenInformation, uint TokenInformationLength, uint &ReturnLength ) : bool
GetWindowThreadProcessId ( IntPtr hWnd, uint &lpdwProcessId ) : uint
GlobalMemoryStatusEx ( [ lpBuffer ) : bool
InitiateSystemShutdownEx ( string lpMachineName, string lpMessage, uint dwTimeout, bool bForceAppsClosed, bool bRebootAfterShutdown, ShutdownReason dwReason ) : bool
IsWow64Process ( IntPtr hProcess, bool &Wow64Process ) : bool
LockServiceDatabase ( IntPtr hSCManager ) : IntPtr
LogonUser ( string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, IntPtr &phToken ) : bool
LookupAccountName ( string lpSystemName, string lpAccountName, IntPtr psid, int &cbsid, StringBuilder domainName, int &cbdomainLength, int &use ) : bool
LookupPrivilegeValue ( string lpSystemName, string lpName, long &lpLuid ) : bool
LsaAddAccountRights ( IntPtr PolicyHandle, IntPtr AccountSid, LSA_UNICODE_STRING UserRights, uint CountOfRights ) : uint
LsaClose ( IntPtr PolicyHandle ) : uint
LsaOpenPolicy ( LSA_UNICODE_STRING &SystemName, LSA_OBJECT_ATTRIBUTES &ObjectAttributes, int DesiredAccess, IntPtr &PolicyHandle ) : uint
OpenProcess ( ProcessAccessTypes dwDesiredAccess, [ bInheritHandle, uint dwProcessId ) : IntPtr
OpenProcessToken ( IntPtr ProcessHandle, uint DesiredAccess, IntPtr &TokenHandle ) : bool
OpenSCManager ( string lpMachineName, string lpDatabaseName, int dwDesiredAccess ) : IntPtr
OpenService ( IntPtr hSCManager, string lpServiceName, int dwDesiredAccess ) : IntPtr
UnlockServiceDatabase ( IntPtr hSCManager ) : bool

Method Details

GetErrorMessage() public static method

Formats and returns a .NET string containing the Windows API level error message corresponding to the specified error code.
public static GetErrorMessage ( int errorCode ) : string
errorCode int An value corresponding to the specified error code.
return string

GetLastErrorMessage() public static method

Formats and returns a .NET string containing the Windows API level error message from the last Win32 call.
public static GetLastErrorMessage ( ) : string
return string