C# Class Interop.Kernel32

Mostra file Open project: dotnet/corefx

Public Methods

Method Description
GetMessage ( IntPtr moduleName, int error ) : string
GetModuleHandle ( string moduleName ) : IntPtr

Private Methods

Method Description
Beep ( int frequency, int duration ) : bool
CancelIoEx ( SafeHandle handle, NativeOverlapped, lpOverlapped ) : bool
CancelThreadpoolIo ( SafeThreadPoolIOHandle pio ) : void
CharCountToByteCount ( int numChars ) : int
CloseHandle ( IntPtr handle ) : bool
CloseThreadpoolIo ( IntPtr pio ) : void
ConnectNamedPipe ( SafePipeHandle handle, IntPtr overlapped ) : bool
ConnectNamedPipe ( SafePipeHandle handle, NativeOverlapped, overlapped ) : bool
CopyFile ( String src, String dst, bool failIfExists ) : int
CopyFile ( string src, string dst, bool failIfExists ) : int
CopyFile2 ( string pwszExistingFileName, string pwszNewFileName, COPYFILE2_EXTENDED_PARAMETERS &pExtendedParameters ) : int
CopyFileEx ( string src, string dst, IntPtr progressRoutine, IntPtr progressData, int &cancel, int flags ) : bool
CopyFileExPrivate ( string src, string dst, IntPtr progressRoutine, IntPtr progressData, int &cancel, int flags ) : bool
CreateDirectory ( string path, SECURITY_ATTRIBUTES, &lpSecurityAttributes ) : bool
CreateDirectoryPrivate ( string path, SECURITY_ATTRIBUTES, &lpSecurityAttributes ) : bool
CreateFile ( string lpFileName, int dwDesiredAccess, FileShare, dwShareMode, [ securityAttrs, FileMode, dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle,
CreateFile ( string lpFileName, int dwDesiredAccess, System dwShareMode, [ securityAttrs, System dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle,
CreateFile2 ( string lpFileName, int dwDesiredAccess, System dwShareMode, System dwCreationDisposition, [ parameters ) : SafeFileHandle,
CreateFileMapping ( IntPtr hFile, SECURITY_ATTRIBUTES, &lpFileMappingAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, string lpName ) : SafeMemoryMappedFileHandle
CreateFileMapping ( SafeFileHandle, hFile, SECURITY_ATTRIBUTES, &lpFileMappingAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, string lpName ) : SafeMemoryMappedFileHandle
CreateFileMappingFromApp ( IntPtr hFile, SECURITY_ATTRIBUTES, &SecurityAttributes, int PageProtection, long MaximumSize, string Name ) : SafeMemoryMappedFileHandle
CreateFileMappingFromApp ( SafeFileHandle, hFile, SECURITY_ATTRIBUTES, &SecurityAttributes, int PageProtection, long MaximumSize, string Name ) : SafeMemoryMappedFileHandle
CreateFilePrivate ( string lpFileName, int dwDesiredAccess, System dwShareMode, [ securityAttrs, System dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle,
CreateNamedPipe ( string pipeName, int openMode, int pipeMode, int maxInstances, int outBufferSize, int inBufferSize, int defaultTimeout, SECURITY_ATTRIBUTES, &securityAttributes ) : SafePipeHandle
CreateNamedPipeClient ( string lpFileName, int dwDesiredAccess, System dwShareMode, SECURITY_ATTRIBUTES, &secAttrs, FileMode, dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafePipeHandle
CreatePipe ( SafeFileHandle, &hReadPipe, SafeFileHandle, &hWritePipe, SECURITY_ATTRIBUTES, &lpPipeAttributes, int nSize ) : bool
CreatePipe ( SafePipeHandle &hReadPipe, SafePipeHandle &hWritePipe, SECURITY_ATTRIBUTES, &lpPipeAttributes, int nSize ) : bool
CreateProcess ( [ lpApplicationName, StringBuilder lpCommandLine, SECURITY_ATTRIBUTES, &procSecAttrs, SECURITY_ATTRIBUTES, &threadSecAttrs, bool bInheritHandles, int dwCreationFlags, IntPtr lpEnvironment, [ lpCurrentDirectory, STARTUPINFO, lpStartupInfo, PROCESS_INFORMATION, lpProcessInformation ) : bool
CreateThreadpoolIo ( SafeHandle fl, [ pfnio, IntPtr context, IntPtr pcbe ) : SafeThreadPoolIOHandle
DeleteFile ( string path ) : bool
DeleteFilePrivate ( string path ) : bool
DeleteVolumeMountPoint ( string mountPoint ) : bool
DeleteVolumeMountPointPrivate ( string mountPoint ) : bool
DisconnectNamedPipe ( SafePipeHandle hNamedPipe ) : bool
DuplicateHandle ( IntPtr hSourceProcessHandle, IntPtr hSourceHandle, IntPtr hTargetProcessHandle, SafeAccessTokenHandle &lpTargetHandle, uint dwDesiredAccess, bool bInheritHandle, uint dwOptions ) : bool
DuplicateHandle ( IntPtr hSourceProcessHandle, SafePipeHandle hSourceHandle, IntPtr hTargetProcessHandle, SafePipeHandle &lpTargetHandle, uint dwDesiredAccess, [ bInheritHandle, uint dwOptions ) : bool
DuplicateHandle ( SafeProcessHandle hSourceProcessHandle, SafeHandle hSourceHandle, SafeProcessHandle hTargetProcess, SafeFileHandle, &targetHandle, int dwDesiredAccess, bool bInheritHandle, int dwOptions ) : bool
DuplicateHandle ( SafeProcessHandle hSourceProcessHandle, SafeHandle hSourceHandle, SafeProcessHandle hTargetProcess, SafeWaitHandle, &targetHandle, int dwDesiredAccess, bool bInheritHandle, int dwOptions ) : bool
EnumProcessModules ( SafeProcessHandle handle, IntPtr modules, int size, int &needed ) : bool
EnumProcesses ( int processIds, int size, int &needed ) : bool
ExpandEnvironmentStringsW ( string lpSrc, [ lpDst, int nSize ) : int
FillConsoleOutputAttribute ( IntPtr hConsoleOutput, short wColorAttribute, int numCells, COORD, startCoord, int &pNumBytesWritten ) : bool
FillConsoleOutputCharacter ( IntPtr hConsoleOutput, char character, int nLength, COORD, dwWriteCoord, int &pNumCharsWritten ) : bool
FindClose ( IntPtr hFindFile ) : bool
FindFirstFile ( string fileName, WIN32_FIND_DATA, &data ) : SafeFindHandle
FindFirstFileExPrivate ( string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, WIN32_FIND_DATA, &lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags ) : SafeFindHandle
FindNextFile ( SafeFindHandle hndFindFile, WIN32_FIND_DATA, &lpFindFileData ) : bool
FlushFileBuffers ( SafeHandle hHandle ) : bool
FlushViewOfFile ( IntPtr lpBaseAddress, UIntPtr dwNumberOfBytesToFlush ) : int
FormatMessage ( int dwFlags, IntPtr lpSource, uint dwMessageId, int dwLanguageId, [ lpBuffer, int nSize, IntPtr arguments ) : int
FreeEnvironmentStringsW ( char pStrings ) : bool
FreeLibrary ( [ hModule ) : bool
GetCPInfoExW ( uint CodePage, uint dwFlags, CPINFOEXW lpCPInfoEx ) : int
GetComputerName ( char lpBuffer, uint &nSize ) : int
GetComputerName ( ) : string
GetConsoleCP ( ) : uint
GetConsoleCursorInfo ( IntPtr hConsoleOutput, CONSOLE_CURSOR_INFO &cci ) : bool
GetConsoleMode ( IntPtr handle, int &mode ) : bool
GetConsoleOutputCP ( ) : uint
GetConsoleScreenBufferInfo ( IntPtr hConsoleOutput, CONSOLE_SCREEN_BUFFER_INFO &lpConsoleScreenBufferInfo ) : bool
GetConsoleTitle ( [ title, int nSize ) : int
GetConsoleTitle ( string &title, int &titleLength ) : int
GetCurrentDirectory ( int nBufferLength, [ lpBuffer ) : int
GetCurrentProcess ( ) : IntPtr
GetCurrentProcess ( ) : SafeProcessHandle
GetCurrentProcessId ( ) : uint
GetCurrentThread ( ) : IntPtr
GetCurrentThreadId ( ) : int
GetDiskFreeSpaceEx ( string drive, long &freeBytesForUser, long &totalBytes, long &freeBytes ) : bool
GetDriveType ( string drive ) : int
GetEnvironmentStringsW ( ) : char*
GetEnvironmentVariableW ( string lpName, [ lpValue, int size ) : int
GetExitCodeProcess ( SafeProcessHandle processHandle, int &exitCode ) : bool
GetFileAttributesEx ( string name, GET_FILEEX_INFO_LEVELS fileInfoLevel, WIN32_FILE_ATTRIBUTE_DATA, &lpFileInformation ) : bool
GetFileAttributesExPrivate ( string name, GET_FILEEX_INFO_LEVELS fileInfoLevel, WIN32_FILE_ATTRIBUTE_DATA, &lpFileInformation ) : bool
GetFileInformationByHandleEx ( SafeFileHandle, hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, FILE_STANDARD_INFO &lpFileInformation, uint dwBufferSize ) : bool
GetFileType ( SafeHandle hFile ) : int
GetFileType ( IntPtr hFile ) : uint
GetFullPathNameW ( char path, uint numBufferChars, SafeHandle buffer, IntPtr mustBeZero ) : uint
GetLargestConsoleWindowSize ( IntPtr hConsoleOutput ) : Interop.Kernel32.COORD,
GetLastError ( ) : int
GetLogicalDrives ( ) : int
GetLogicalProcessorInformationEx ( LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType, IntPtr Buffer, uint &ReturnedLength ) : bool
GetLongPathName ( string path, [ longPathBuffer, int bufferLength ) : int
GetLongPathNamePrivate ( string path, [ longPathBuffer, int bufferLength ) : int
GetLongPathNameW ( SafeHandle lpszShortPath, SafeHandle lpszLongPath, uint cchBuffer ) : uint
GetMessage ( int errorCode ) : string

Returns a string message for the specified Win32 error code.

GetModuleBaseName ( SafeProcessHandle processHandle, IntPtr moduleHandle, [ baseName, int size ) : int
GetModuleFileNameEx ( SafeProcessHandle processHandle, IntPtr moduleHandle, [ baseName, int size ) : int
GetModuleInformation ( SafeProcessHandle processHandle, IntPtr moduleHandle, NtModuleInfo &ntModuleInfo ) : bool
GetModuleInformation ( SafeProcessHandle processHandle, IntPtr moduleHandle, NtModuleInfo &ntModuleInfo, int size ) : bool
GetNamedPipeHandleState ( SafePipeHandle hNamedPipe, IntPtr lpState, IntPtr lpCurInstances, IntPtr lpMaxCollectionCount, IntPtr lpCollectDataTimeout, [ lpUserName, int nMaxUserNameSize ) : bool
GetNamedPipeHandleState ( SafePipeHandle hNamedPipe, IntPtr lpState, int &lpCurInstances, IntPtr lpMaxCollectionCount, IntPtr lpCollectDataTimeout, IntPtr lpUserName, int nMaxUserNameSize ) : bool
GetNamedPipeHandleState ( SafePipeHandle hNamedPipe, int &lpState, IntPtr lpCurInstances, IntPtr lpMaxCollectionCount, IntPtr lpCollectDataTimeout, IntPtr lpUserName, int nMaxUserNameSize ) : bool
GetNamedPipeInfo ( SafePipeHandle hNamedPipe, IntPtr lpFlags, IntPtr lpOutBufferSize, int &lpInBufferSize, IntPtr lpMaxInstances ) : bool
GetNamedPipeInfo ( SafePipeHandle hNamedPipe, IntPtr lpFlags, int &lpOutBufferSize, IntPtr lpInBufferSize, IntPtr lpMaxInstances ) : bool
GetNamedPipeInfo ( SafePipeHandle hNamedPipe, int &lpFlags, IntPtr lpOutBufferSize, IntPtr lpInBufferSize, IntPtr lpMaxInstances ) : bool
GetNativeSystemInfo ( SYSTEM_INFO, &lpSystemInfo ) : void
GetPriorityClass ( SafeProcessHandle handle ) : int
GetProcAddress ( SafeLibraryHandle hModule, string lpProcName ) : IntPtr
GetProcessAffinityMask ( SafeProcessHandle handle, IntPtr &processMask, IntPtr &systemMask ) : bool
GetProcessPriorityBoost ( SafeProcessHandle handle, bool &disabled ) : bool
GetProcessTimes ( SafeProcessHandle handle, long &creation, long &exit, long &kernel, long &user ) : bool
GetProcessWorkingSetSizeEx ( SafeProcessHandle handle, IntPtr &min, IntPtr &max, int &flags ) : bool
GetStdHandle ( int nStdHandle ) : IntPtr
GetSystemInfo ( SYSTEM_INFO, &lpSystemInfo ) : void
GetTempFileNameW ( string tmpPath, string prefix, uint uniqueIdOrZero, [ tmpFileName ) : uint
GetTempPathW ( int bufferLen, [ buffer ) : uint
GetThreadPriority ( SafeThreadHandle handle ) : int
GetThreadPriorityBoost ( SafeThreadHandle handle, bool &disabled ) : bool
GetThreadTimes ( SafeThreadHandle handle, long &creation, long &exit, long &kernel, long &user ) : bool
GetTickCount64 ( ) : long
GetVersionExW ( OSVERSIONINFOEX &osvi ) : bool
GetVolumeInformation ( string drive, [ volumeName, int volumeNameBufLen, int &volSerialNumber, int &maxFileNameLen, int &fileSystemFlags, [ fileSystemName, int fileSystemNameBufLen ) : bool
GlobalMemoryStatusEx ( MEMORYSTATUSEX, &lpBuffer ) : int
IsGetConsoleModeCallSuccessful ( IntPtr handle ) : bool
IsNormalizedString ( int normForm, string source, int length ) : bool
IsWow64Process ( IntPtr hProcess, bool &Wow64Process ) : bool
IsWow64Process ( SafeProcessHandle hProcess, bool &Wow64Process ) : bool
LoadLibraryExW ( [ lpwLibFileName, [ hFile, [ dwFlags ) : SafeLibraryHandle
LocalAlloc ( int uFlags, UIntPtr sizetdwBytes ) : SafeLocalAllocHandle
LocalAlloc_SafeOverlappedFree ( int uFlags, UIntPtr sizetdwBytes ) : SafeOverlappedFree
LocalFree ( IntPtr handle ) : IntPtr
LockFile ( SafeFileHandle, handle, int offsetLow, int offsetHigh, int countLow, int countHigh ) : bool
MapViewOfFile ( SafeMemoryMappedFileHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap ) : SafeMemoryMappedViewHandle
MapViewOfFileFromApp ( SafeMemoryMappedFileHandle hFileMappingObject, int DesiredAccess, long FileOffset, UIntPtr NumberOfBytesToMap ) : SafeMemoryMappedViewHandle
MoveFile ( string src, string dst ) : bool
MoveFileExPrivate ( string src, string dst, uint flags ) : bool
NormalizeString ( int normForm, string source, int sourceLength, [ destination, int destinationLength ) : int
OpenFileMapping ( int dwDesiredAccess, [ bInheritHandle, string lpName ) : SafeMemoryMappedFileHandle
OpenProcess ( int access, bool inherit, int processId ) : SafeProcessHandle
OpenThread ( int access, bool inherit, int threadId ) : SafeThreadHandle
OutputDebugString ( string message ) : void
PeekConsoleInput ( IntPtr hConsoleInput, InputRecord &buffer, int numInputRecords_UseOne, int &numEventsRead ) : bool
QueryPerformanceCounter ( long &value ) : bool
QueryPerformanceFrequency ( long &value ) : bool
ReadConsole ( IntPtr hConsoleInput, Byte lpBuffer, Int32 nNumberOfCharsToRead, Int32 &lpNumberOfCharsRead, IntPtr pInputControl ) : bool
ReadConsoleInput ( IntPtr hConsoleInput, InputRecord &buffer, int numInputRecords_UseOne, int &numEventsRead ) : bool
ReadConsoleOutput ( IntPtr hConsoleOutput, CHAR_INFO pBuffer, COORD, bufferSize, COORD, bufferCoord, SMALL_RECT &readRegion ) : bool
ReadDirectoryChangesW ( SafeFileHandle, hDirectory, byte lpBuffer, int nBufferLength, [ bWatchSubtree, int dwNotifyFilter, int &lpBytesReturned, NativeOverlapped, lpOverlapped, IntPtr lpCompletionRoutine ) : bool
ReadFile ( IntPtr handle, byte bytes, int numBytesToRead, int &numBytesRead, IntPtr mustBeZero ) : int
ReadFile ( SafeHandle handle, byte bytes, int numBytesToRead, IntPtr numBytesRead_mustBeZero, NativeOverlapped, overlapped ) : int
ReadFile ( SafeHandle handle, byte bytes, int numBytesToRead, int &numBytesRead, IntPtr mustBeZero ) : int
RemoveDirectory ( string path ) : bool
RemoveDirectoryPrivate ( string path ) : bool
ReplaceFile ( string replacedFileName, string replacementFileName, string backupFileName, int dwReplaceFlags, IntPtr lpExclude, IntPtr lpReserved ) : bool
ReplaceFilePrivate ( string replacedFileName, string replacementFileName, string backupFileName, int dwReplaceFlags, IntPtr lpExclude, IntPtr lpReserved ) : bool
ResolveLocaleName ( string lpNameToResolve, StringBuilder lpLocaleName, int cchLocaleName ) : int
SafeCreateFile ( String lpFileName, int dwDesiredAccess, System dwShareMode, Interop, &securityAttrs, FileMode, dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle,
SetConsoleCP ( int codePage ) : bool
SetConsoleCtrlHandler ( ConsoleCtrlHandlerRoutine handler, bool addOrRemove ) : bool
SetConsoleCursorInfo ( IntPtr hConsoleOutput, CONSOLE_CURSOR_INFO &cci ) : bool
SetConsoleCursorPosition ( IntPtr hConsoleOutput, COORD, cursorPosition ) : bool
SetConsoleMode ( IntPtr handle, int mode ) : bool
SetConsoleOutputCP ( int codePage ) : bool
SetConsoleScreenBufferSize ( IntPtr hConsoleOutput, Interop, size ) : bool
SetConsoleTextAttribute ( IntPtr hConsoleOutput, short wAttributes ) : int
SetConsoleTitle ( string title ) : bool
SetConsoleWindowInfo ( IntPtr hConsoleOutput, bool absolute, SMALL_RECT consoleWindow ) : bool
SetCurrentDirectory ( string path ) : bool
SetEndOfFile ( SafeFileHandle, hFile ) : bool
SetEnvironmentVariableW ( string lpName, string lpValue ) : bool
SetErrorMode ( uint newMode ) : uint
SetFileAttributes ( string name, int attr ) : bool
SetFileAttributesPrivate ( string name, int attr ) : bool
SetFileInformationByHandle ( SafeFileHandle, hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, FILE_BASIC_INFO &lpFileInformation, uint dwBufferSize ) : bool
SetFilePointerEx ( SafeFileHandle, hFile, long liDistanceToMove, long &lpNewFilePointer, uint dwMoveMethod ) : bool
SetFileTime ( SafeFileHandle, hFile, long creationTime = -1, long lastAccessTime = -1, long lastWriteTime = -1, long changeTime = -1, uint fileAttributes ) : bool
SetLastError ( uint dwErrCode ) : void
SetNamedPipeHandleState ( SafePipeHandle hNamedPipe, int lpMode, IntPtr lpMaxCollectionCount, IntPtr lpCollectDataTimeout ) : bool
SetPriorityClass ( SafeProcessHandle handle, int priorityClass ) : bool
SetProcessAffinityMask ( SafeProcessHandle handle, IntPtr mask ) : bool
SetProcessPriorityBoost ( SafeProcessHandle handle, bool disabled ) : bool
SetProcessWorkingSetSizeEx ( SafeProcessHandle handle, IntPtr min, IntPtr max, int flags ) : bool
SetThreadAffinityMask ( SafeThreadHandle handle, IntPtr mask ) : IntPtr
SetThreadIdealProcessor ( SafeThreadHandle handle, int processor ) : int
SetThreadPriority ( SafeThreadHandle handle, int priority ) : bool
SetThreadPriorityBoost ( SafeThreadHandle handle, bool disabled ) : bool
SetVolumeLabel ( string driveLetter, string volumeName ) : bool
StartThreadpoolIo ( SafeThreadPoolIOHandle pio ) : void
TerminateProcess ( SafeProcessHandle processHandle, int exitCode ) : bool
TryGetACPCodePage ( int &codePage ) : bool
TryGetErrorMessage ( IntPtr moduleHandle, int errorCode, StringBuilder sb, string &errorMsg ) : bool
UnlockFile ( SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh ) : bool
UnmapViewOfFile ( IntPtr lpBaseAddress ) : int
UnsafeCreateFile ( string lpFileName, int dwDesiredAccess, FileShare dwShareMode, Interop &securityAttrs, FileMode dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle
UnsafeCreateFile ( string lpFileName, int dwDesiredAccess, System dwShareMode, Interop &securityAttrs, System dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle
VerLanguageName ( uint langID, [ lpBuffer, uint nSize ) : int
VirtualAlloc ( SafeHandle lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect ) : IntPtr
VirtualQuery ( SafeMemoryMappedViewHandle lpAddress, MEMORY_BASIC_INFORMATION &lpBuffer, UIntPtr dwLength ) : UIntPtr
WaitNamedPipe ( string name, int timeout ) : bool
WideCharToMultiByte ( uint CodePage, uint dwFlags, char lpWideCharStr, int cchWideChar, byte lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar, IntPtr lpUsedDefaultChar ) : int
WriteConsole ( IntPtr hConsoleOutput, Byte lpBuffer, Int32 nNumberOfCharsToWrite, Int32 &lpNumberOfCharsWritten, IntPtr lpReservedMustBeNull ) : bool
WriteConsoleOutput ( IntPtr hConsoleOutput, CHAR_INFO buffer, COORD bufferSize, COORD bufferCoord, SMALL_RECT &writeRegion ) : bool
WriteFile ( IntPtr handle, byte bytes, int numBytesToWrite, int &numBytesWritten, IntPtr mustBeZero ) : int
WriteFile ( SafeHandle handle, byte bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped lpOverlapped ) : int
WriteFile ( SafeHandle handle, byte bytes, int numBytesToWrite, int &numBytesWritten, IntPtr mustBeZero ) : int

Method Details

GetMessage() public static method

public static GetMessage ( IntPtr moduleName, int error ) : string
moduleName IntPtr
error int
return string

GetModuleHandle() public static method

public static GetModuleHandle ( string moduleName ) : IntPtr
moduleName string
return IntPtr