Kernel.cs
1 using System; 2 using System.Runtime.InteropServices; 3 using System.Text; 4 5 using HANDLE = System.IntPtr; 6 using HWND = System.IntPtr; 7 8 namespace Win32 9 { 10 public struct OVERLAPPED 11 { 12 public int Internal; 13 public int InternalHigh; 14 public int offset; 15 public int OffsetHigh; 16 public HANDLE hEvent; 17 } 18 public struct SECURITY_ATTRIBUTES 19 { 20 public int nLength; 21 public int lpSecurityDescriptor; 22 public int bInheritHandle; 23 } 24 public struct PROCESS_INFORMATION 25 { 26 public HANDLE hProcess; 27 public HANDLE hThread; 28 public int dwProcessId; 29 public int dwThreadId; 30 } 31 public struct COMMPROP 32 { 33 public short wPacketLength; 34 public short wPacketVersion; 35 public int dwServiceMask; 36 public int dwReserved1; 37 public int dwMaxTxQueue; 38 public int dwMaxRxQueue; 39 public int dwMaxBaud; 40 public int dwProvSubType; 41 public int dwProvCapabilities; 42 public int dwSettableParams; 43 public int dwSettableBaud; 44 public short wSettableData; 45 public short wSettableStopParity; 46 public int dwCurrentTxQueue; 47 public int dwCurrentRxQueue; 48 public int dwProvSpec1; 49 public int dwProvSpec2; 50 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public short[] wcProvChar; 51 } 52 public struct COMSTAT 53 { 54 public int fBitFields; 55 public int cbInQue; 56 public int cbOutQue; 57 } 58 public struct DCB 59 { 60 public int DCBlength; 61 public int BaudRate; 62 public int fBitFields; 63 public short wReserved; 64 public short XonLim; 65 public short XoffLim; 66 public byte ByteSize; 67 public byte Parity; 68 public byte StopBits; 69 public byte XonChar; 70 public byte XoffChar; 71 public byte ErrorChar; 72 public byte EofChar; 73 public byte EvtChar; 74 public short wReserved1; 75 } 76 public struct COMMTIMEOUTS 77 { 78 public int ReadIntervalTimeout; 79 public int ReadTotalTimeoutMultiplier; 80 public int ReadTotalTimeoutConstant; 81 public int WriteTotalTimeoutMultiplier; 82 public int WriteTotalTimeoutConstant; 83 } 84 public struct SYSTEM_INFO 85 { 86 public int dwOemID; 87 public int dwPageSize; 88 public int lpMinimumApplicationAddress; 89 public int lpMaximumApplicationAddress; 90 public int dwActiveProcessorMask; 91 public int dwNumberOrfProcessors; 92 public int dwProcessorType; 93 public int dwAllocationGranularity; 94 public int dwReserved; 95 } 96 #region Global Memory Flags 97 #endregion 98 public struct MEMORYSTATUS 99 { 100 public int dwLength; 101 public int dwMemoryLoad; 102 public int dwTotalPhys; 103 public int dwAvailPhys; 104 public int dwTotalPageFile; 105 public int dwAvailPageFile; 106 public int dwTotalVirtual; 107 public int dwAvailVirtual; 108 } 109 public struct GENERIC_MAPPING 110 { 111 public int GenericRead; 112 public int GenericWrite; 113 public int GenericExecute; 114 public int GenericAll; 115 } 116 public struct LUID 117 { 118 public int LowPart; 119 public int HighPart; 120 } 121 public struct LUID_AND_ATTRIBUTES 122 { 123 public LUID pLuid; 124 public int Attributes; 125 } 126 public struct ACL 127 { 128 public byte AclRevision; 129 public byte Sbz1; 130 public short AclSize; 131 public short AceCount; 132 public short Sbz2; 133 } 134 public struct ACE_HEADER 135 { 136 public byte AceType; 137 public byte AceFlags; 138 public int AceSize; 139 } 140 public struct ACCESS_ALLOWED_ACE 141 { 142 public ACE_HEADER Header; 143 public int Mask; 144 public int SidStart; 145 } 146 public struct ACCESS_DENIED_ACE 147 { 148 public ACE_HEADER Header; 149 public int Mask; 150 public int SidStart; 151 } 152 public struct SYSTEM_AUDIT_ACE 153 { 154 public ACE_HEADER Header; 155 public int Mask; 156 public int SidStart; 157 } 158 public struct SYSTEM_ALARM_ACE 159 { 160 public ACE_HEADER Header; 161 public int Mask; 162 public int SidStart; 163 } 164 public struct ACL_REVISION_INFORMATION 165 { 166 public int AclRevision; 167 } 168 public struct ACL_SIZE_INFORMATION 169 { 170 public int AceCount; 171 public int AclBytesInUse; 172 public int AclBytesFree; 173 } 174 public struct SECURITY_DESCRIPTOR 175 { 176 public byte Revision; 177 public byte Sbz1; 178 public int Control; 179 public int Owner; 180 public int Group; 181 public ACL Sacl; 182 public ACL Dacl; 183 } 184 public struct PRIVILEGE_SET 185 { 186 public int PrivilegeCount; 187 public int Control; 188 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public LUID_AND_ATTRIBUTES[] Privilege; 189 } 190 public struct EXCEPTION_RECORD 191 { 192 public int ExceptionCode; 193 public int ExceptionFlags; 194 public int pExceptionRecord; 195 public int ExceptionAddress; 196 public int NumberParameters; 197 [MarshalAs(UnmanagedType.ByValArray, SizeConst=15)] public int [] ExceptionInformation; 198 } 199 public struct EXCEPTION_DEBUG_INFO 200 { 201 public EXCEPTION_RECORD pExceptionRecord; 202 public int dwFirstChance; 203 } 204 public struct CREATE_THREAD_DEBUG_INFO 205 { 206 public HANDLE hThread; 207 public int lpThreadLocalBase; 208 public int lpStartAddress; 209 } 210 public struct CREATE_PROCESS_DEBUG_INFO 211 { 212 public HANDLE hFile; 213 public HANDLE hProcess; 214 public HANDLE hThread; 215 public int lpBaseOfImage; 216 public int dwDebugInfoFileOffset; 217 public int nDebugInfoSize; 218 public int lpThreadLocalBase; 219 public int lpStartAddress; 220 public int lpImageName; 221 public short fUnicode; 222 } 223 public struct EXIT_THREAD_DEBUG_INFO 224 { 225 public int dwExitCode; 226 } 227 public struct EXIT_PROCESS_DEBUG_INFO 228 { 229 public int dwExitCode; 230 } 231 public struct LOAD_DLL_DEBUG_INFO 232 { 233 public HANDLE hFile; 234 public int lpBaseOfDll; 235 public int dwDebugInfoFileOffset; 236 public int nDebugInfoSize; 237 public int lpImageName; 238 public short fUnicode; 239 } 240 public struct UNLOAD_DLL_DEBUG_INFO 241 { 242 public int lpBaseOfDll; 243 } 244 public struct OUTPUT_DEBUG_STRING_INFO 245 { 246 public string lpDebugStringData; 247 public short fUnicode; 248 public short nDebugStringLength; 249 } 250 public struct RIP_INFO 251 { 252 public int dwError; 253 public int dwType; 254 } 255 public struct OFSTRUCT 256 { 257 public byte cBytes; 258 public byte fFixedDisk; 259 public short nErrCode; 260 public short Reserved1; 261 public short Reserved2; 262 [MarshalAs(UnmanagedType.ByValArray, SizeConst=128)] public byte[] szPathName; 263 } 264 public struct CRITICAL_SECTION 265 { 266 public int pDebugInfo; 267 public int LockCount; 268 public int RecursionCount; 269 public int pOwningThread; 270 public int pLockSemaphore; 271 public int Reserved; 272 } 273 public struct BY_HANDLE_FILE_INFORMATION 274 { 275 public int dwFileAttributes; 276 public FILETIME ftCreationTime; 277 public FILETIME ftLastAccessTime; 278 public FILETIME ftLastWriteTime; 279 public int dwVolumeSerialNumber; 280 public int nFileSizeHigh; 281 public int nFileSizeLow; 282 public int nNumberOfLinks; 283 public int nFileIndexHigh; 284 public int nFileIndexLow; 285 } 286 public struct MEMORY_BASIC_INFORMATION 287 { 288 public int BaseAddress; 289 public int AllocationBase; 290 public int AllocationProtect; 291 public int RegionSize; 292 public int State; 293 public int Protect; 294 public int lType; 295 } 296 public struct EVENTLOGRECORD 297 { 298 public int Length; 299 public int Reserved; 300 public int RecordNumber; 301 public int TimeGenerated; 302 public int TimeWritten; 303 public int EventID; 304 public short EventType; 305 public short NumStrings; 306 public short EventCategory; 307 public short ReservedFlags; 308 public int ClosingRecordNumber; 309 public int StringOffset; 310 public int UserSidLength; 311 public int UserSidOffset; 312 public int DataLength; 313 public int DataOffset; 314 } 315 public struct TOKEN_GROUPS 316 { 317 public int GroupCount; 318 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public SID_AND_ATTRIBUTES[] Groups; 319 } 320 public struct TOKEN_PRIVILEGES 321 { 322 public int PrivilegeCount; 323 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public LUID_AND_ATTRIBUTES[] Privileges; 324 } 325 public struct CONTEXT 326 { 327 public double FltF0; 328 public double FltF1; 329 public double FltF2; 330 public double FltF3; 331 public double FltF4; 332 public double FltF5; 333 public double FltF6; 334 public double FltF7; 335 public double FltF8; 336 public double FltF9; 337 public double FltF10; 338 public double FltF11; 339 public double FltF12; 340 public double FltF13; 341 public double FltF14; 342 public double FltF15; 343 public double FltF16; 344 public double FltF17; 345 public double FltF18; 346 public double FltF19; 347 public double FltF20; 348 public double FltF21; 349 public double FltF22; 350 public double FltF23; 351 public double FltF24; 352 public double FltF25; 353 public double FltF26; 354 public double FltF27; 355 public double FltF28; 356 public double FltF29; 357 public double FltF30; 358 public double FltF31; 359 public double IntV0; 360 public double IntT0; 361 public double IntT1; 362 public double IntT2; 363 public double IntT3; 364 public double IntT4; 365 public double IntT5; 366 public double IntT6; 367 public double IntT7; 368 public double IntS0; 369 public double IntS1; 370 public double IntS2; 371 public double IntS3; 372 public double IntS4; 373 public double IntS5; 374 public double IntFp; 375 public double IntA0; 376 public double IntA1; 377 public double IntA2; 378 public double IntA3; 379 public double IntA4; 380 public double IntA5; 381 public double IntT8; 382 public double IntT9; 383 public double IntT10; 384 public double IntT11; 385 public double IntRa; 386 public double IntT12; 387 public double IntAt; 388 public double IntGp; 389 public double IntSp; 390 public double IntZero; 391 public double Fpcr; 392 public double SoftFpcr; 393 public double Fir; 394 public int Psr; 395 public int ContextFlags; 396 [MarshalAs(UnmanagedType.ByValArray, SizeConst=4)] public int []Fill; 397 } 398 public struct EXCEPTION_POINTERS 399 { 400 public EXCEPTION_RECORD pExceptionRecord; 401 public CONTEXT ContextRecord; 402 } 403 public struct LDT_BYTES 404 { 405 public byte BaseMid; 406 public byte Flags1; 407 public byte Flags2; 408 public byte BaseHi; 409 } 410 public struct LDT_ENTRY 411 { 412 public short LimitLow; 413 public short BaseLow; 414 public int HighWord; 415 } 416 public struct TIME_ZONE_INFORMATION 417 { 418 public int Bias; 419 [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] public short[] StandardName; 420 public SYSTEMTIME StandardDate; 421 public int StandardBias; 422 [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] public short[] DaylightName; 423 public SYSTEMTIME DaylightDate; 424 public int DaylightBias; 425 } 426 public struct WIN32_STREAM_ID 427 { 428 public int dwStreamID; 429 public int dwStreamAttributes; 430 public int dwStreamSizeLow; 431 public int dwStreamSizeHigh; 432 public int dwStreamNameSize; 433 public byte cStreamName; 434 } 435 public struct STARTUPINFO 436 { 437 public int cb; 438 public string lpReserved; 439 public string lpDesktop; 440 public string lpTitle; 441 public int dwX; 442 public int dwY; 443 public int dwXSize; 444 public int dwYSize; 445 public int dwXCountChars; 446 public int dwYCountChars; 447 public int dwFillAttribute; 448 public int dwFlags; 449 public short wShowWindow; 450 public short cbReserved2; 451 public int lpReserved2; 452 public HANDLE hStdInput; 453 public HANDLE hStdOutput; 454 public HANDLE hStdError; 455 } 456 public struct CPINFO 457 { 458 public int MaxCharSize; 459 [MarshalAs(UnmanagedType.ByValArray, SizeConst=Kernel.MAX_DEFAULTCHAR)] public byte[] DefaultChar; 460 [MarshalAs(UnmanagedType.ByValArray, SizeConst=Kernel.MAX_LEADBYTES)] public byte[] LeadByte; 461 } 462 public struct NUMBERFMT 463 { 464 public int NumDigits; 465 public int LeadingZero; 466 public int Grouping; 467 public string lpDecimalSep; 468 public string lpThousandSep; 469 public int NegativeOrder; 470 } 471 public struct CURRENCYFMT 472 { 473 public int NumDigits; 474 public int LeadingZero; 475 public int Grouping; 476 public string lpDecimalSep; 477 public string lpThousandSep; 478 public int NegativeOrder; 479 public int PositiveOrder; 480 public string lpCurrencySymbol; 481 } 482 public struct COORD 483 { 484 public short x; 485 public short y; 486 } 487 public struct SMALL_RECT 488 { 489 public short Left; 490 public short Top; 491 public short Right; 492 public short Bottom; 493 } 494 public struct KEY_EVENT_RECORD 495 { 496 public int bKeyDown; 497 public short wRepeatCount; 498 public short wVirtualKeyCode; 499 public short wVirtualScanCode; 500 public byte uChar; 501 public int dwControlKeyState; 502 } 503 public struct MOUSE_EVENT_RECORD 504 { 505 public COORD dwMousePosition; 506 public int dwButtonState; 507 public int dwControlKeyState; 508 public int dwEventFlags; 509 } 510 public struct WINDOW_BUFFER_SIZE_RECORD 511 { 512 public COORD dwSize; 513 } 514 public struct MENU_EVENT_RECORD 515 { 516 public int dwCommandId; 517 } 518 public struct FOCUS_EVENT_RECORD 519 { 520 public int bSetFocus; 521 } 522 public struct CHAR_INFO 523 { 524 public short Char; 525 public short Attributes; 526 } 527 public struct CONSOLE_SCREEN_BUFFER_INFO 528 { 529 public COORD dwSize; 530 public COORD dwCursorPosition; 531 public short wAttributes; 532 public SMALL_RECT srWindow; 533 public COORD dwMaximumWindowSize; 534 } 535 public struct CONSOLE_CURSOR_INFO 536 { 537 public int dwSize; 538 public int bVisible; 539 } 540 public struct SID_IDENTIFIER_AUTHORITY 541 { 542 [MarshalAs(UnmanagedType.ByValArray, SizeConst=6)] public byte[] Value; 543 } 544 public struct SID_AND_ATTRIBUTES 545 { 546 public int Sid; 547 public int Attributes; 548 } 549 public struct WIN32_FIND_DATA 550 { 551 public int dwFileAttributes; 552 public FILETIME ftCreationTime; 553 public FILETIME ftLastAccessTime; 554 public FILETIME ftLastWriteTime; 555 public int nFileSizeHigh; 556 public int nFileSizeLow; 557 public int dwReserved0; 558 public int dwReserved1; 559 [MarshalAs(UnmanagedType.ByValTStr, SizeConst=Kernel.MAX_PATH)] 560 public string cFileName; 561 [MarshalAs(UnmanagedType.ByValTStr, SizeConst=14)] 562 public string cAlternate; 563 } 564 public struct COMMCONFIG 565 { 566 public int dwSize; 567 public short wVersion; 568 public short wReserved; 569 public DCB dcbx; 570 public int dwProviderSubType; 571 public int dwProviderOffset; 572 public int dwProviderSize; 573 public byte wcProviderData; 574 } 575 public struct SERVICE_STATUS 576 { 577 public int dwServiceType; 578 public int dwCurrentState; 579 public int dwControlsAccepted; 580 public int dwWin32ExitCode; 581 public int dwServiceSpecificExitCode; 582 public int dwCheckPoint; 583 public int dwWaitHint; 584 } 585 public struct ENUM_SERVICE_STATUS 586 { 587 public string lpServiceName; 588 public string lpDisplayName; 589 public SERVICE_STATUS ServiceStatus; 590 } 591 public struct QUERY_SERVICE_LOCK_STATUS 592 { 593 public int fIsLocked; 594 public string lpLockOwner; 595 public int dwLockDuration; 596 } 597 public struct QUERY_SERVICE_CONFIG 598 { 599 public int dwServiceType; 600 public int dwStartType; 601 public int dwErrorControl; 602 public string lpBinaryPathName; 603 public string lpLoadOrderGroup; 604 public int dwTagId; 605 public string lpDependencies; 606 public string lpServiceStartName; 607 public string lpDisplayName; 608 } 609 public struct SERVICE_TABLE_ENTRY 610 { 611 public string lpServiceName; 612 public int lpServiceProc; 613 } 614 public struct LARGE_INTEGER 615 { 616 public int lowpart; 617 public int highpart; 618 } 619 public struct PERF_DATA_BLOCK 620 { 621 [MarshalAs(UnmanagedType.ByValTStr, SizeConst=4)] public string Signature; 622 public int LittleEndian; 623 public int Version; 624 public int Revision; 625 public int TotalByteLength; 626 public int HeaderLength; 627 public int NumObjectTypes; 628 public int DefaultObject; 629 public SYSTEMTIME SystemTime; 630 public LARGE_INTEGER PerfTime; 631 public LARGE_INTEGER PerfFreq; 632 public LARGE_INTEGER PerTime100nSec; 633 public int SystemNameLength; 634 public int SystemNameOffset; 635 } 636 public struct PERF_OBJECT_TYPE 637 { 638 public int TotalByteLength; 639 public int DefinitionLength; 640 public int HeaderLength; 641 public int ObjectNameTitleIndex; 642 public string ObjectNameTitle; 643 public int ObjectHelpTitleIndex; 644 public string ObjectHelpTitle; 645 public int DetailLevel; 646 public int NumCounters; 647 public int DefaultCounter; 648 public int NumInstances; 649 public int CodePage; 650 public LARGE_INTEGER PerfTime; 651 public LARGE_INTEGER PerfFreq; 652 } 653 public struct PERF_COUNTER_DEFINITION 654 { 655 public int ByteLength; 656 public int CounterNameTitleIndex; 657 public string CounterNameTitle; 658 public int CounterHelpTitleIndex; 659 public string CounterHelpTitle; 660 public int DefaultScale; 661 public int DetailLevel; 662 public int CounterType; 663 public int CounterSize; 664 public int CounterOffset; 665 } 666 public struct PERF_INSTANCE_DEFINITION 667 { 668 public int ByteLength; 669 public int ParentObjectTitleIndex; 670 public int ParentObjectInstance; 671 public int UniqueID; 672 public int NameOffset; 673 public int NameLength; 674 } 675 public struct PERF_COUNTER_BLOCK 676 { 677 public int ByteLength; 678 } 679 public struct OSVERSIONINFO 680 { 681 public int dwOSVersionInfoSize; 682 public int dwMajorVersion; 683 public int dwMinorVersion; 684 public int dwBuildNumber; 685 public int dwPlatformId; 686 [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string szCSDVersion; 687 } 688 public struct SYSTEM_POWER_STATUS 689 { 690 public byte ACLineStatus; 691 public byte BatteryFlag; 692 public byte BatteryLifePercent; 693 public byte Reserved1; 694 public int BatteryLifeTime; 695 public int BatteryFullLifeTime; 696 } 697 698 public abstract class AdvApi 699 { 700 [DllImport("AdvApi32")] public static extern int ImpersonateLoggedOnUser(HANDLE hToken); 701 [DllImport("advapi32")] public static extern int IsTextUnicode(IntPtr lpBuffer, int cb, ref int lpi); 702 [DllImport("advapi32")] public static extern int LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref int phToken); 703 [DllImport("advapi32")] public static extern int NotifyChangeEventLog(HANDLE hEventLog, HANDLE hEvent); 704 [DllImport("advapi32")] public static extern int SetThreadToken(int Thread, int Token); 705 [DllImport("advapi32")] public static extern Byte GetSidSubAuthorityCount(IntPtr pSid); 706 [DllImport("advapi32")] public static extern SID_IDENTIFIER_AUTHORITY GetSidIdentifierAuthority(IntPtr pSid); 707 [DllImport("advapi32")] public static extern int AbortSystemShutdown(string lpMachineName); 708 [DllImport("advapi32")] public static extern int AccessCheck(ref SECURITY_DESCRIPTOR pSecurityDescriptor, int ClientToken, int DesiredAccess, GENERIC_MAPPING GenericMapping, PRIVILEGE_SET PrivilegeSet, int PrivilegeSetLength, int GrantedAccess, int Status); 709 [DllImport("advapi32")] public static extern int AccessCheckAndAuditAlarm(string SubsystemName, IntPtr HandleId, string ObjectTypeName, string ObjectName, SECURITY_DESCRIPTOR SecurityDescriptor, int DesiredAccess, GENERIC_MAPPING GenericMapping, int ObjectCreation, int GrantedAccess, int AccessStatus, ref int pfGenerateOnClose); 710 [DllImport("advapi32")] public static extern int AddAccessAllowedAce(ref ACL pAcl, int dwAceRevision, int AccessMask, IntPtr pSid); 711 [DllImport("advapi32")] public static extern int AddAccessDeniedAce(ref ACL pAcl, int dwAceRevision, int AccessMask, IntPtr pSid); 712 [DllImport("advapi32")] public static extern int AddAce(ref ACL pAcl, int dwAceRevision, int dwStartingAceIndex, IntPtr pAceList, int nAceListLength); 713 [DllImport("advapi32")] public static extern int AddAuditAccessAce(ref ACL pAcl, int dwAceRevision, int dwAccessMask, IntPtr pSid, int bAuditSuccess, int bAuditFailure); 714 [DllImport("advapi32")] public static extern int AdjustTokenGroups(int TokenHandle, int ResetToDefault, TOKEN_GROUPS NewState, int BufferLength, TOKEN_GROUPS PreviousState, int ReturnLength); 715 [DllImport("advapi32")] public static extern int AdjustTokenPrivileges(int TokenHandle, int DisableAllPrivileges, TOKEN_PRIVILEGES NewState, int BufferLength, TOKEN_PRIVILEGES PreviousState, int ReturnLength); 716 [DllImport("advapi32")] public static extern int AllocateAndInitializeSid(ref SID_IDENTIFIER_AUTHORITY pIdentifierAuthority, Byte nSubAuthorityCount, int nSubAuthority0, int nSubAuthority1, int nSubAuthority2, int nSubAuthority3, int nSubAuthority4, int nSubAuthority5, int nSubAuthority6, int nSubAuthority7, ref int lpPSid); 717 [DllImport("advapi32")] public static extern int AllocateLocallyUniqueId(LARGE_INTEGER Luid); 718 [DllImport("advapi32")] public static extern int AreAllAccessesGranted(int GrantedAccess, int DesiredAccess); 719 [DllImport("advapi32")] public static extern int AreAnyAccessesGranted(int GrantedAccess, int DesiredAccess); 720 [DllImport("advapi32")] public static extern int BackupEventLog(HANDLE hEventLog, string lpBackupFileName); 721 [DllImport("advapi32")] public static extern int ChangeServiceConfig(HANDLE hService, int dwServiceType, int dwStartType, int dwErrorControl, string lpBinaryPathName, string lpLoadOrderGroup, ref int lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword, string lpDisplayName); 722 [DllImport("advapi32")] public static extern int ClearEventLog(HANDLE hEventLog, string lpBackupFileName); 723 [DllImport("advapi32")] public static extern int CloseEventLog(HANDLE hEventLog); 724 [DllImport("advapi32")] public static extern int CloseServiceHandle(HANDLE hSCObject); 725 [DllImport("advapi32")] public static extern int ControlService(HANDLE hService, int dwControl, ref SERVICE_STATUS lpServiceStatus); 726 [DllImport("advapi32")] public static extern int CopySid(int nDestinationSidLength, IntPtr pDestinationSid, IntPtr pSourceSid); 727 [DllImport("advapi32")] public static extern int CreatePrivateObjectSecurity(ref SECURITY_DESCRIPTOR ParentDescriptor, SECURITY_DESCRIPTOR CreatorDescriptor, SECURITY_DESCRIPTOR NewDescriptor, int IsDirectoryObject, int Token, GENERIC_MAPPING GenericMapping); 728 [DllImport("advapi32")] public static extern int CreateProcessAsUser(HANDLE hToken, string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, int dwCreationFlags, string lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, ref PROCESS_INFORMATION lpProcessInformation); 729 [DllImport("advapi32")] public static extern int CreateService(HANDLE hSCManager, string lpServiceName, string lpDisplayName, int dwDesiredAccess, int dwServiceType, int dwStartType, int dwErrorControl, string lpBinaryPathName, string lpLoadOrderGroup, ref int lpdwTagId, string lpDependencies, string lp, string lpPassword); 730 [DllImport("advapi32")] public static extern int DeleteAce(ref ACL pAcl, int dwAceIndex); 731 [DllImport("advapi32")] public static extern int DeleteService(HANDLE hService); 732 [DllImport("advapi32")] public static extern int DeregisterEventSource(HANDLE hEventLog); 733 [DllImport("advapi32")] public static extern int DestroyPrivateObjectSecurity(ref SECURITY_DESCRIPTOR ObjectDescriptor); 734 [DllImport("advapi32")] public static extern int DuplicateToken(int ExistingTokenHandle, short ImpersonationLevel, int DuplicateTokenHandle); 735 [DllImport("advapi32")] public static extern int EnumDependentServices(HANDLE hService, int dwServiceState, ref ENUM_SERVICE_STATUS lpServices, int cbBufSize, ref int pcbBytesNeeded, ref int lpServicesReturned); 736 [DllImport("advapi32")] public static extern int EnumServicesStatus(HANDLE hSCManager, int dwServiceType, int dwServiceState, ref ENUM_SERVICE_STATUS lpServices, int cbBufSize, ref int pcbBytesNeeded, ref int lpServicesReturned, ref int lpResumeHandle); 737 [DllImport("advapi32")] public static extern int EqualPrefixSid(IntPtr pSid1, IntPtr pSid2); 738 [DllImport("advapi32")] public static extern int EqualSid(IntPtr pSid1, IntPtr pSid2); 739 [DllImport("advapi32")] public static extern int FindFirstFreeAce(ref ACL pAcl, ref int pAce); 740 [DllImport("advapi32")] public static extern int GetAce(ref ACL pAcl, int dwAceIndex, IntPtr pAce); 741 [DllImport("advapi32")] public static extern int GetAclInformation(ref ACL pAcl, IntPtr pAclInformation, int nAclInformationLength, short dwAclInformationClass); 742 [DllImport("advapi32")] public static extern int GetFileSecurity(string lpFileName, int RequestedInformation, ref SECURITY_DESCRIPTOR pSecurityDescriptor, int nLength, ref int lpnLengthNeeded); 743 [DllImport("advapi32")] public static extern int GetKernelObjectSecurity(HANDLE handle, int RequestedInformation, ref SECURITY_DESCRIPTOR pSecurityDescriptor, int nLength, ref int lpnLengthNeeded); 744 [DllImport("advapi32")] public static extern int GetLengthSid(IntPtr pSid); 745 [DllImport("advapi32")] public static extern int GetNumberOfEventLogRecords(HANDLE hEventLog, int NumberOfRecords); 746 [DllImport("advapi32")] public static extern int GetOldestEventLogRecord(HANDLE hEventLog, int OldestRecord); 747 [DllImport("advapi32")] public static extern int GetPrivateObjectSecurity(ref SECURITY_DESCRIPTOR ObjectDescriptor, int SecurityInformation, SECURITY_DESCRIPTOR ResultantDescriptor, int DescriptorLength, int ReturnLength); 748 [DllImport("advapi32")] public static extern int GetSecurityDescriptorControl(ref SECURITY_DESCRIPTOR pSecurityDescriptor, short pControl, ref int lpdwRevision); 749 [DllImport("advapi32")] public static extern int GetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR pSecurityDescriptor, ref int lpbDaclPresent, ref ACL pDacl, ref int lpbDaclDefaulted); 750 [DllImport("advapi32")] public static extern int GetSecurityDescriptorGroup(ref SECURITY_DESCRIPTOR pSecurityDescriptor, IntPtr pGroup, ref int lpbGroupDefaulted); 751 [DllImport("advapi32")] public static extern int GetSecurityDescriptorLength(ref SECURITY_DESCRIPTOR pSecurityDescriptor); 752 [DllImport("advapi32")] public static extern int GetSecurityDescriptorOwner(ref SECURITY_DESCRIPTOR pSecurityDescriptor, IntPtr pOwner, ref int lpbOwnerDefaulted); 753 [DllImport("advapi32")] public static extern int GetSecurityDescriptorSacl(ref SECURITY_DESCRIPTOR pSecurityDescriptor, ref int lpbSaclPresent, ref ACL pSacl, ref int lpbSaclDefaulted); 754 [DllImport("advapi32")] public static extern int GetServiceDisplayName(HANDLE hSCManager, string lpServiceName, StringBuilder lpDisplayName, ref int cchBuffer); 755 [DllImport("advapi32")] public static extern int GetServiceKeyName(HANDLE hSCManager, string lpDisplayName, StringBuilder lpServiceName, ref int cchBuffer); 756 [DllImport("advapi32")] public static extern int GetSidLengthRequired(Byte nSubAuthorityCount); 757 [DllImport("advapi32")] public static extern int GetSidSubAuthority(IntPtr pSid, int nSubAuthority); 758 [DllImport("advapi32")] public static extern int GetTokenInformation(int TokenHandle, short TokenInformationClass, IntPtr TokenInformation, int TokenInformationLength, int ReturnLength); 759 [DllImport("advapi32")] public static extern int GetUserName(StringBuilder lpBuffer, int nSize); 760 [DllImport("advapi32")] public static extern int ImpersonateNamedPipeClient(HANDLE hNamedPipe); 761 [DllImport("advapi32")] public static extern int ImpersonateSelf(short ImpersonationLevel); 762 [DllImport("advapi32")] public static extern int InitializeAcl(ref ACL pAcl, int nAclLength, int dwAclRevision); 763 [DllImport("advapi32")] public static extern int InitializeSecurityDescriptor(ref SECURITY_DESCRIPTOR pSecurityDescriptor, int dwRevision); 764 [DllImport("advapi32")] public static extern int InitializeSid(IntPtr Sid, ref SID_IDENTIFIER_AUTHORITY pIdentifierAuthority, Byte nSubAuthorityCount); 765 [DllImport("advapi32")] public static extern int InitiateSystemShutdown(string lpMachineName, string lpMessage, int dwTimeout, int bForceAppsClosed, int bRebootAfterShutdown); 766 [DllImport("advapi32")] public static extern int IsValidAcl(ref ACL pAcl); 767 [DllImport("advapi32")] public static extern int IsValidSecurityDescriptor(ref SECURITY_DESCRIPTOR pSecurityDescriptor); 768 [DllImport("advapi32")] public static extern int IsValidSid(IntPtr pSid); 769 [DllImport("advapi32")] public static extern int LockServiceDatabase(HANDLE hSCManager); 770 [DllImport("advapi32")] public static extern int LookupAccountName(string lpSystemName, string lpAccountName, int Sid, int cbSid, string ReferencedDomainName, int cbReferencedDomainName, int peUse); 771 [DllImport("advapi32")] public static extern int LookupAccountSid(string lpSystemName, IntPtr Sid, string name, int cbName, string ReferencedDomainName, int cbReferencedDomainName, int peUse); 772 [DllImport("advapi32")] public static extern int LookupPrivilegeDisplayName(string lpSystemName, string lpName, string lpDisplayName, int cbDisplayName, ref int lpLanguageID); 773 [DllImport("advapi32")] public static extern int LookupPrivilegeName(string lpSystemName, ref LARGE_INTEGER lpLuid, string lpName, int cbName); 774 [DllImport("advapi32")] public static extern int LookupPrivilegeValue(string lpSystemName, string lpName, ref LARGE_INTEGER lpLuid); 775 [DllImport("advapi32")] public static extern int MakeAbsoluteSD(ref SECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, ref SECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, ref int lpdwAbsoluteSecurityDescriptorSize, ref ACL pDacl, ref int lpdwDaclSize, ref ACL pSacl, ref int lpdwSaclSize, IntPtr pOwner, ref int lpdwOwnerSize, IntPtr pPrimaryGroup, ref int lpdwPrimaryGroupSize); 776 [DllImport("advapi32")] public static extern int MakeSelfRelativeSD(ref SECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, ref SECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, ref int lpdwBufferLength); 777 [DllImport("advapi32")] public static extern int NotifyBootConfigStatus(int BootAcceptable); 778 [DllImport("advapi32")] public static extern int ObjectCloseAuditAlarm(string SubsystemName, IntPtr HandleId, int GenerateOnClose); 779 [DllImport("advapi32")] public static extern int ObjectPrivilegeAuditAlarm(string SubsystemName, IntPtr HandleId, int ClientToken, int DesiredAccess, PRIVILEGE_SET Privileges, int AccessGranted); 780 [DllImport("advapi32")] public static extern int OpenBackupEventLog(string lpUNCServerName, string lpFileName); 781 [DllImport("advapi32")] public static extern int OpenEventLog(string lpUNCServerName, string lpSourceName); 782 [DllImport("advapi32")] public static extern int OpenSCManager(string lpMachineName, string lpDatabaseName, int dwDesiredAccess); 783 [DllImport("advapi32")] public static extern int OpenService(HANDLE hSCManager, string lpServiceName, int dwDesiredAccess); 784 [DllImport("advapi32")] public static extern int OpenThreadToken(int ThreadHandle, int DesiredAccess, int OpenAsSelf, int TokenHandle); 785 [DllImport("advapi32")] public static extern int PrivilegeCheck(int ClientToken, PRIVILEGE_SET RequiredPrivileges, ref int pfResult); 786 [DllImport("advapi32")] public static extern int PrivilegedServiceAuditAlarm(string SubsystemName, string ServiceName, int ClientToken, PRIVILEGE_SET Privileges, int AccessGranted); 787 [DllImport("advapi32")] public static extern int QueryServiceConfig(HANDLE hService, ref QUERY_SERVICE_CONFIG lpServiceConfig, int cbBufSize, ref int pcbBytesNeeded); 788 [DllImport("advapi32")] public static extern int QueryServiceLockStatus(HANDLE hSCManager, ref QUERY_SERVICE_LOCK_STATUS lpLockStatus, int cbBufSize, ref int pcbBytesNeeded); 789 [DllImport("advapi32")] public static extern int QueryServiceObjectSecurity(HANDLE hService, int dwSecurityInformation, IntPtr lpSecurityDescriptor, int cbBufSize, ref int pcbBytesNeeded); 790 [DllImport("advapi32")] public static extern int QueryServiceStatus(HANDLE hService, ref SERVICE_STATUS lpServiceStatus); 791 [DllImport("advapi32")] public static extern int ReadEventLog(HANDLE hEventLog, int dwReadFlags, int dwRecordOffset, ref EVENTLOGRECORD lpBuffer, int nNumberOfBytesToRead, ref int pnBytesRead, ref int pnMinNumberOfBytesNeeded); 792 [DllImport("advapi32")] public static extern int RegCloseKey(HANDLE hKey); 793 [DllImport("advapi32")] public static extern int RegConnectRegistry(string lpMachineName, HANDLE hKey, ref int phkResult); 794 [DllImport("advapi32")] public static extern int RegCreateKey(HANDLE hKey, string lpSubKey, ref int phkResult); 795 [DllImport("advapi32")] public static extern int RegCreateKeyEx(HANDLE hKey, string lpSubKey, int Reserved, string lpClass, int dwOptions, int samDesired, ref SECURITY_ATTRIBUTES lpSecurityAttributes, ref int phkResult, ref int lpdwDisposition); 796 [DllImport("advapi32")] public static extern int RegDeleteKey(HANDLE hKey, string lpSubKey); 797 [DllImport("advapi32")] public static extern int RegDeleteValue(HANDLE hKey, string lpValueName); 798 [DllImport("advapi32")] public static extern int RegEnumKey(HANDLE hKey, int dwIndex, string lpName, int cbName); 799 [DllImport("advapi32")] public static extern int RegEnumKeyEx(HANDLE hKey, int dwIndex, string lpName, ref int lpcbName, ref int lpReserved, string lpClass, ref int lpcbClass, ref FILETIME lpftLastWriteTime); 800 [DllImport("advapi32")] public static extern int RegEnumValue(HANDLE hKey, int dwIndex, string lpValueName, ref int lpcbValueName, ref int lpReserved, ref int lpType, Byte lpData, ref int lpcbData); 801 [DllImport("advapi32")] public static extern int RegFlushKey(HANDLE hKey); 802 [DllImport("advapi32")] public static extern int RegGetKeySecurity(HANDLE hKey, int SecurityInformation, ref SECURITY_DESCRIPTOR pSecurityDescriptor, ref int lpcbSecurityDescriptor); 803 [DllImport("advapi32")] public static extern int RegLoadKey(HANDLE hKey, string lpSubKey, string lpFile); 804 [DllImport("advapi32")] public static extern int RegNotifyChangeKeyValue(HANDLE hKey, int bWatchSubtree, int dwNotifyFilter, HANDLE hEvent, int fAsynchronus); 805 [DllImport("advapi32")] public static extern int RegOpenKey(HANDLE hKey, string lpSubKey, ref int phkResult); 806 [DllImport("advapi32")] public static extern int RegOpenKeyEx(HANDLE hKey, string lpSubKey, int ulOptions, int samDesired, ref int phkResult); 807 [DllImport("advapi32")] public static extern int RegQueryInfoKey(HANDLE hKey, string lpClass, ref int lpcbClass, ref int lpReserved, ref int lpcSubKeys, ref int lpcbMaxSubKeyLen, ref int lpcbMaxClassLen, ref int lpcValues, ref int lpcbMaxValueNameLen, ref int lpcbMaxValueLen, ref int lpcbSecurityDescriptor, ref FILETIME lpftLastWriteTime); 808 [DllImport("advapi32")] public static extern int RegQueryValue(HANDLE hKey, string lpSubKey, string lpValue, ref int lpcbValue); 809 [DllImport("advapi32")] public static extern int RegQueryValueEx(HANDLE hKey, string lpValueName, ref int lpReserved, ref int lpType, IntPtr lpData, ref int lpcbData); 810 [DllImport("advapi32")] public static extern int RegReplaceKey(HANDLE hKey, string lpSubKey, string lpNewFile, string lpOldFile); 811 [DllImport("advapi32")] public static extern int RegRestoreKey(HANDLE hKey, string lpFile, int dwFlags); 812 [DllImport("advapi32")] public static extern int RegSaveKey(HANDLE hKey, string lpFile, ref SECURITY_ATTRIBUTES lpSecurityAttributes); 813 [DllImport("advapi32")] public static extern int RegSetKeySecurity(HANDLE hKey, int SecurityInformation, ref SECURITY_DESCRIPTOR pSecurityDescriptor); 814 [DllImport("advapi32")] public static extern int RegSetValue(HANDLE hKey, string lpSubKey, int dwType, string lpData, int cbData); 815 [DllImport("advapi32")] public static extern int RegSetValueEx(HANDLE hKey, string lpValueName, int Reserved, int dwType, IntPtr lpData, int cbData); 816 [DllImport("advapi32")] public static extern int RegUnLoadKey(HANDLE hKey, string lpSubKey); 817 [DllImport("advapi32")] public static extern int RegisterEventSource(string lpUNCServerName, string lpSourceName); 818 [DllImport("advapi32")] public static extern int RegisterServiceCtrlHandler(string lpServiceName, ref int lpHandlerProc); 819 [DllImport("advapi32")] public static extern int ReportEvent(HANDLE hEventLog, int wType, int wCategory, int dwEventID, IntPtr lpUserSid, int wNumStrings, int dwDataSize, ref int lpStrings, IntPtr lpRawData); 820 [DllImport("advapi32")] public static extern int RevertToSelf(); 821 [DllImport("advapi32")] public static extern int SetAclInformation(ref ACL pAcl, IntPtr pAclInformation, int nAclInformationLength, short dwAclInformationClass); 822 [DllImport("advapi32")] public static extern int SetFileSecurity(string lpFileName, int SecurityInformation, ref SECURITY_DESCRIPTOR pSecurityDescriptor); 823 [DllImport("advapi32")] public static extern int SetKernelObjectSecurity(HANDLE handle, int SecurityInformation, SECURITY_DESCRIPTOR SecurityDescriptor); 824 [DllImport("advapi32")] public static extern int SetPrivateObjectSecurity(int SecurityInformation, SECURITY_DESCRIPTOR ModificationDescriptor, SECURITY_DESCRIPTOR ObjectsSecurityDescriptor, GENERIC_MAPPING GenericMapping, int Token); 825 [DllImport("advapi32")] public static extern int SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR pSecurityDescriptor, int bDaclPresent, ref ACL pDacl, int bDaclDefaulted); 826 [DllImport("advapi32")] public static extern int SetSecurityDescriptorGroup(ref SECURITY_DESCRIPTOR pSecurityDescriptor, IntPtr pGroup, int bGroupDefaulted); 827 [DllImport("advapi32")] public static extern int SetSecurityDescriptorOwner(ref SECURITY_DESCRIPTOR pSecurityDescriptor, IntPtr pOwner, int bOwnerDefaulted); 828 [DllImport("advapi32")] public static extern int SetSecurityDescriptorSacl(ref SECURITY_DESCRIPTOR pSecurityDescriptor, int bSaclPresent, ref ACL pSacl, int bSaclDefaulted); 829 [DllImport("advapi32")] public static extern int SetServiceObjectSecurity(HANDLE hService, int dwSecurityInformation, IntPtr lpSecurityDescriptor); 830 [DllImport("advapi32")] public static extern int SetServiceStatus(HANDLE hServiceStatus, ref SERVICE_STATUS lpServiceStatus); 831 [DllImport("advapi32")] public static extern int SetTokenInformation(int TokenHandle, short TokenInformationClass, IntPtr TokenInformation, int TokenInformationLength); 832 [DllImport("advapi32")] public static extern int StartService(HANDLE hService, int dwNumServiceArgs, ref int lpServiceArgVectors); 833 [DllImport("advapi32")] public static extern int StartServiceCtrlDispatcher(ref SERVICE_TABLE_ENTRY lpServiceStartTable); 834 [DllImport("advapi32")] public static extern int UnlockServiceDatabase(IntPtr ScLock); 835 [DllImport("advapi32")] public static extern void FreeSid(IntPtr pSid); 836 [DllImport("advapi32")] public static extern void MapGenericMask(int AccessMask, GENERIC_MAPPING GenericMapping); 837 [DllImport("advapi32")] public static extern int GetUserNameW(Byte lpBuffer, int nSize); 838 [DllImport("advapi32")] public static extern int OpenProcessToken(int ProcessHandle, int DesiredAccess, int TokenHandle); 839 } 840 841 public abstract class Version 842 { 843 [DllImport("version")] public static extern int GetFileVersionInfo(string lptstrFilename, int dwHandle, int dwLen, IntPtr lpData); 844 [DllImport("version")] public static extern int GetFileVersionInfoSize(string lptstrFilename, ref int lpdwHandle); 845 [DllImport("version")] public static extern int VerFindFile(int uFlags, string szFileName, string szWinDir, string szAppDir, string szCurDir, ref int lpuCurDirLen, string szDestDir, ref int lpuDestDirLen); 846 [DllImport("version")] public static extern int VerInstallFile(int uFlags, string szSrcFileName, string szDestFileName, string szSrcDir, string szDestDir, string szCurDir, string szTmpFile, ref int lpuTmpFileLen); 847 [DllImport("version")] public static extern int VerQueryValue(IntPtr pBlock, string lpSubBlock, ref int lplpBuffer, ref int puLen); 848 } 849 850 public abstract class Kernel 851 { 852 [DllImport("kernel32")] public static extern void OutputDebugString(string lpszOutputString); 853 [DllImport("KERNEL32")] public static extern int ConvertDefaultLocale(int Locale); 854 [DllImport("KERNEL32")] public static extern int EnumDateFormats(int lpDateFmtEnumProc, int Locale, int dwFlags); 855 [DllImport("KERNEL32")] public static extern int EnumSystemCodePages(int lpCodePageEnumProc, int dwFlags); 856 [DllImport("KERNEL32")] public static extern int EnumSystemLocales(int lpLocaleEnumProc, int dwFlags); 857 [DllImport("KERNEL32")] public static extern int EnumTimeFormats(int lpTimeFmtEnumProc, int Locale, int dwFlags); 858 [DllImport("KERNEL32")] public static extern int GetThreadLocale(); 859 [DllImport("KERNEL32")] public static extern int IsValidLocale(int Locale, int dwFlags); 860 [DllImport("KERNEL32")] public static extern void ZeroMemory(IntPtr dest, int numBytes); 861 [DllImport("kernel32")] public static extern COORD GetLargestConsoleWindowSize(HANDLE hConsoleOutput); 862 [DllImport("kernel32")] public static extern int AllocConsole(); 863 [DllImport("kernel32")] public static extern int BackupRead(HANDLE hFile, Byte lpBuffer, int nNumberOfBytesToRead, ref int lpNumberOfBytesRead, int bAbort, int bProcessSecurity, IntPtr lpContext); 864 [DllImport("kernel32")] public static extern int BackupSeek(HANDLE hFile, int dwLowBytesToSeek, int dwHighBytesToSeek, ref int lpdwLowByteSeeked, ref int lpdwHighByteSeeked, ref int lpContext); 865 [DllImport("kernel32")] public static extern int BackupWrite(HANDLE hFile, Byte lpBuffer, int nNumberOfBytesToWrite, ref int lpNumberOfBytesWritten, int bAbort, int bProcessSecurity, ref int lpContext); 866 [DllImport("kernel32")] public static extern int Beep(int dwFreq, int dwDuration); 867 [DllImport("kernel32")] public static extern int BeginUpdateResource(string pFileName, int bDeleteExistingResources); 868 [DllImport("kernel32")] public static extern int BuildCommDCB(string lpDef, ref DCB lpDCB); 869 [DllImport("kernel32")] public static extern int BuildCommDCBAndTimeouts(string lpDef, ref DCB lpDCB, ref COMMTIMEOUTS lpCommTimeouts); 870 [DllImport("kernel32")] public static extern int CallNamedPipe(string lpNamedPipeName, IntPtr lpInBuffer, int nInBufferSize, IntPtr lpOutBuffer, int nOutBufferSize, ref int lpBytesRead, int nTimeOut); 871 [DllImport("kernel32")] public static extern int ClearCommBreak(int nCid); 872 [DllImport("kernel32")] public static extern int ClearCommError(HANDLE hFile, ref int lpErrors, ref COMSTAT lpStat); 873 [DllImport("kernel32")] public static extern int CloseHandle(HANDLE hObject); 874 [DllImport("kernel32")] public static extern int CommConfigDialog(string lpszName, HWND hwnd, ref COMMCONFIG lpCC); 875 [DllImport("kernel32")] public static extern int CompareFileTime(ref FILETIME lpFileTime1, ref FILETIME lpFileTime2); 876 [DllImport("kernel32")] public static extern int CompareString(int Locale, int dwCmpFlags, string lpString1, int cchCount1, string lpString2, int cchCount2); 877 [DllImport("kernel32")] public static extern int ConnectNamedPipe(HANDLE hNamedPipe, ref OVERLAPPED lpOverlapped); 878 [DllImport("kernel32")] public static extern int ContinueDebugEvent(int dwProcessId, int dwThreadId, int dwContinueStatus); 879 [DllImport("kernel32")] public static extern int CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists); 880 [DllImport("kernel32")] public static extern int CreateConsoleScreenBuffer(int dwDesiredAccess, int dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, int dwFlags, IntPtr lpScreenBufferData); 881 [DllImport("kernel32")] public static extern int CreateDirectory(string lpPathName, ref SECURITY_ATTRIBUTES lpSecurityAttributes); 882 [DllImport("kernel32")] public static extern int CreateDirectoryEx(string lpTemplateDirectory, string lpNewDirectory, ref SECURITY_ATTRIBUTES lpSecurityAttributes); 883 [DllImport("kernel32")] public static extern int CreateEvent(ref SECURITY_ATTRIBUTES lpEventAttributes, int bManualReset, int bInitialState, string lpName); 884 [DllImport("kernel32")] public static extern int CreateFile(string lpFileName, int dwDesiredAccess, int dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, HANDLE hTemplateFile); 885 [DllImport("kernel32")] public static extern int CreateFileMapping(HANDLE hFile, ref SECURITY_ATTRIBUTES lpFileMappigAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, string lpName); 886 [DllImport("kernel32")] public static extern int CreateIoCompletionPort(int FileHandle, int ExistingCompletionPort, int CompletionKey, int NumberOfConcurrentThreads); 887 [DllImport("kernel32")] public static extern int CreateMailslot(string lpName, int nMaxMessageSize, int lReadTimeout, ref SECURITY_ATTRIBUTES lpSecurityAttributes); 888 [DllImport("kernel32")] public static extern int CreateMutex(ref SECURITY_ATTRIBUTES lpMutexAttributes, int bInitialOwner, string lpName); 889 [DllImport("kernel32")] public static extern int CreateNamedPipe(string lpName, int dwOpenMode, int dwPipeMode, int nMaxInstances, int nOutBufferSize, int nInBufferSize, int nDefaultTimeOut, ref SECURITY_ATTRIBUTES lpSecurityAttributes); 890 [DllImport("kernel32")] public static extern int CreatePipe(int phReadPipe, int phWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize); 891 [DllImport("kernel32")] public static extern int CreateProcess(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, int dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDriectory, ref STARTUPINFO lpStartupInfo, ref PROCESS_INFORMATION lpProcessInformation); 892 [DllImport("kernel32")] public static extern int CreateRemoteThread(HANDLE hProcess, ref SECURITY_ATTRIBUTES lpThreadAttributes, int dwStackSize, ref int lpStartAddress, IntPtr lpParameter, int dwCreationFlags, ref int lpThreadId); 893 [DllImport("kernel32")] public static extern int CreateSemaphore(ref SECURITY_ATTRIBUTES lpSemaphoreAttributes, int lInitialCount, int lMaximumCount, string lpName); 894 [DllImport("kernel32")] public static extern int CreateTapePartition(HANDLE hDevice, int dwPartitionMethod, int dwCount, int dwSize); 895 [DllImport("kernel32")] public static extern int CreateThread(ref SECURITY_ATTRIBUTES lpThreadAttributes, int dwStackSize, ref int lpStartAddress, IntPtr lpParameter, int dwCreationFlags, ref int lpThreadId); 896 [DllImport("kernel32")] public static extern int DebugActiveProcess(int dwProcessId); 897 [DllImport("kernel32")] public static extern int DefineDosDevice(int dwFlags, string lpDeviceName, string lpTargetPath); 898 [DllImport("kernel32")] public static extern int DeleteFile(string lpFileName); 899 [DllImport("kernel32")] public static extern int DeviceIoControl(HANDLE hDevice, int dwIoControlCode, IntPtr lpInBuffer, int nInBufferSize, IntPtr lpOutBuffer, int nOutBufferSize, ref int lpBytesReturned, ref OVERLAPPED lpOverlapped); 900 [DllImport("kernel32")] public static extern int DisableThreadLibraryCalls(HANDLE hLibModule); 901 [DllImport("kernel32")] public static extern int DisconnectNamedPipe(HANDLE hNamedPipe); 902 [DllImport("kernel32")] public static extern int DosDateTimeToFileTime(int wFatDate, int wFatTime, ref FILETIME lpFileTime); 903 [DllImport("kernel32")] public static extern int DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHandle, HANDLE hTargetProcessHandle, ref int lpTargetHandle, int dwDesiredAccess, int bInheritHandle, int dwOptions); 904 [DllImport("kernel32")] public static extern int EndUpdateResource(HANDLE hUpdate, int fDiscard); 905 [DllImport("kernel32")] public static extern int EnumCalendarInfo(int lpCalInfoEnumProc, int Locale, int Calendar, int CalType); 906 [DllImport("kernel32")] public static extern int EnumResourceLanguages(HANDLE hModule, string lpType, string lpName, ref int lpEnumFunc, int lParam); 907 [DllImport("kernel32")] public static extern int EnumResourceNames(HANDLE hModule, string lpType, ref int lpEnumFunc, int lParam); 908 [DllImport("kernel32")] public static extern int EnumResourceTypes(HANDLE hModule, ref int lpEnumFunc, int lParam); 909 [DllImport("kernel32")] public static extern int EraseTape(HANDLE hDevice, int dwEraseType, int bimmediate); 910 [DllImport("kernel32")] public static extern int EscapeCommFunction(int nCid, int nFunc); 911 [DllImport("kernel32")] public static extern int ExpandEnvironmentStrings(string lpSrc, string lpDst, int nSize); 912 [DllImport("kernel32")] public static extern int FileTimeToDosDateTime(ref FILETIME lpFileTime, ref int lpFatDate, ref int lpFatTime); 913 [DllImport("kernel32")] public static extern int FileTimeToLocalFileTime(ref FILETIME lpFileTime, ref FILETIME lpLocalFileTime); 914 [DllImport("kernel32")] public static extern int FileTimeToSystemTime(ref FILETIME lpFileTime, ref SYSTEMTIME lpSystemTime); 915 [DllImport("kernel32")] public static extern int FillConsoleOutputAttribute(HANDLE hConsoleOutput, int wAttribute, int nLength, COORD dwWriteCoord, ref int lpNumberOfAttrsWritten); 916 [DllImport("kernel32")] public static extern int FillConsoleOutputCharacter(HANDLE hConsoleOutput, Byte cCharacter, int nLength, COORD dwWriteCoord, ref int lpNumberOfCharsWritten); 917 [DllImport("kernel32")] public static extern int FindClose(HANDLE hFindFile); 918 [DllImport("kernel32")] public static extern int FindCloseChangeNotification(HANDLE hChangeHandle); 919 [DllImport("kernel32")] public static extern int FindFirstChangeNotification(string lpPathName, int bWatchSubtree, int dwNotifyFilter); 920 [DllImport("kernel32")] public static extern int FindFirstFile(string lpFileName, WIN32_FIND_DATA lpFindFileData); 921 [DllImport("kernel32")] public static extern int FindNextChangeNotification(HANDLE hChangeHandle); 922 [DllImport("kernel32")] public static extern int FindNextFile(HANDLE hFindFile, WIN32_FIND_DATA lpFindFileData); 923 [DllImport("kernel32")] public static extern int FindResource(HANDLE hInstance, string lpName, string lpType); 924 [DllImport("kernel32")] public static extern int FindResourceEx(HANDLE hModule, string lpType, string lpName, int wLanguage); 925 [DllImport("kernel32")] public static extern int FlushConsoleInputBuffer(HANDLE hConsoleInput); 926 [DllImport("kernel32")] public static extern int FlushFileBuffers(HANDLE hFile); 927 [DllImport("kernel32")] public static extern int FlushInstructionCache(HANDLE hProcess, IntPtr lpBaseAddress, int dwSize); 928 [DllImport("kernel32")] public static extern int FlushViewOfFile(IntPtr lpBaseAddress, int dwNumberOfBytesToFlush); 929 [DllImport("kernel32")] public static extern int FoldString(int dwMapFlags, string lpSrcStr, int cchSrc, string lpDestStr, int cchDest); 930 [DllImport("kernel32")] public static extern int FormatMessage(int dwFlags, IntPtr lpSource, int dwMessageId, int dwLanguageId, string lpBuffer, int nSize, int Arguments); 931 [DllImport("kernel32")] public static extern int FreeConsole(); 932 [DllImport("kernel32")] public static extern int FreeEnvironmentStrings(string lpsz); 933 [DllImport("kernel32")] public static extern int FreeLibrary(HANDLE hLibModule); 934 [DllImport("kernel32")] public static extern int FreeResource(HANDLE hResData); 935 [DllImport("kernel32")] public static extern int GenerateConsoleCtrlEvent(int dwCtrlEvent, int dwProcessGroupId); 936 [DllImport("kernel32")] public static extern int GetACP(); 937 [DllImport("kernel32")] public static extern int GetBinaryType(string lpApplicationName, ref int lpBinaryType); 938 [DllImport("kernel32")] public static extern int GetCPInfo(int CodePage, ref CPINFO lpCPInfo); 939 [DllImport("kernel32")] public static extern int GetCommConfig(HANDLE hCommDev, ref COMMCONFIG lpCC, ref int lpdwSize); 940 [DllImport("kernel32")] public static extern int GetCommMask(HANDLE hFile, ref int lpEvtMask); 941 [DllImport("kernel32")] public static extern int GetCommModemStatus(HANDLE hFile, ref int lpModemStat); 942 [DllImport("kernel32")] public static extern int GetCommProperties(HANDLE hFile, ref COMMPROP lpCommProp); 943 [DllImport("kernel32")] public static extern int GetCommState(int nCid, ref DCB lpDCB); 944 [DllImport("kernel32")] public static extern int GetCommTimeouts(HANDLE hFile, ref COMMTIMEOUTS lpCommTimeouts); 945 [DllImport("kernel32")] public static extern int GetCommandLine(); 946 [DllImport("kernel32")] public static extern int GetCompressedFileSize(string lpFileName, ref int lpFileSizeHigh); 947 [DllImport("kernel32")] public static extern int GetComputerName(string lpBuffer, int nSize); 948 [DllImport("kernel32")] public static extern int GetConsoleCP(); 949 [DllImport("kernel32")] public static extern int GetConsoleCursorInfo(HANDLE hConsoleOutput, ref CONSOLE_CURSOR_INFO lpConsoleCursorInfo); 950 [DllImport("kernel32")] public static extern int GetConsoleMode(HANDLE hConsoleHandle, ref int lpMode); 951 [DllImport("kernel32")] public static extern int GetConsoleOutputCP(); 952 [DllImport("kernel32")] public static extern int GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, ref CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo); 953 [DllImport("kernel32")] public static extern int GetConsoleTitle(string lpConsoleTitle, int nSize); 954 [DllImport("kernel32")] public static extern int GetCurrencyFormat(int Locale, int dwFlags, string lpValue, ref CURRENCYFMT lpFormat, string lpCurrencyStr, int cchCurrency); 955 [DllImport("kernel32")] public static extern int GetCurrentDirectory(int nBufferLength, string lpBuffer); 956 [DllImport("kernel32")] public static extern int GetCurrentProcess(); 957 [DllImport("kernel32")] public static extern int GetCurrentProcessId(); 958 [DllImport("kernel32")] public static extern int GetCurrentThread(); 959 [DllImport("kernel32")] public static extern int GetCurrentThreadId(); 960 [DllImport("kernel32")] public static extern int GetCurrentTime(); 961 [DllImport("kernel32")] public static extern int GetDateFormat(int Locale, int dwFlags, ref SYSTEMTIME lpDate, string lpFormat, string lpDateStr, int cchDate); 962 [DllImport("kernel32")] public static extern int GetDefaultCommConfig(string lpszName, ref COMMCONFIG lpCC, ref int lpdwSize); 963 [DllImport("kernel32")] public static extern int GetDiskFreeSpace(string lpRootPathName, ref int lpSectorsPerCluster, ref int lpBytesPerSector, ref int lpNumberOfFreeClusters, ref int lpTotalNumberOfClusters); 964 [DllImport("kernel32")] public static extern int GetDriveType(string nDrive); 965 [DllImport("kernel32")] public static extern int GetEnvironmentVariable(string lpName, string lpBuffer, int nSize); 966 [DllImport("kernel32")] public static extern int GetExitCodeProcess(HANDLE hProcess, ref int lpExitCode); 967 [DllImport("kernel32")] public static extern int GetExitCodeThread(HANDLE hThread, ref int lpExitCode); 968 [DllImport("kernel32")] public static extern int GetFileAttributes(string lpFileName); 969 [DllImport("kernel32")] public static extern int GetFileInformationByHandle(HANDLE hFile, ref BY_HANDLE_FILE_INFORMATION lpFileInformation); 970 [DllImport("kernel32")] public static extern int GetFileSize(HANDLE hFile, ref int lpFileSizeHigh); 971 [DllImport("kernel32")] public static extern int GetFileTime(HANDLE hFile, ref FILETIME lpCreationTime, ref FILETIME lpLastAccessTime, ref FILETIME lpLastWriteTime); 972 [DllImport("kernel32")] public static extern int GetFileType(HANDLE hFile); 973 [DllImport("kernel32")] public static extern int GetFullPathName(string lpFileName, int nBufferLength, StringBuilder lpBuffer, string lpFilePart); 974 [DllImport("kernel32")] public static extern int GetHandleInformation(HANDLE hObject, ref int lpdwFlags); 975 [DllImport("kernel32")] public static extern int GetLastError(); 976 [DllImport("kernel32")] public static extern int GetLocaleInfo(int Locale, int LCType, string lpLCData, int cchData); 977 [DllImport("kernel32")] public static extern int GetLogicalDriveStrings(int nBufferLength, StringBuilder lpBuffer); 978 [DllImport("kernel32")] public static extern int GetLogicalDrives(); 979 [DllImport("kernel32")] public static extern int GetMailslotInfo(HANDLE hMailslot, ref int lpMaxMessageSize, ref int lpNextSize, ref int lpMessageCount, ref int lpReadTimeout); 980 [DllImport("kernel32")] public static extern int GetModuleFileName(HANDLE hModule, StringBuilder lpFileName, int nSize); 981 [DllImport("kernel32")] public static extern int GetModuleHandle(string lpModuleName); 982 [DllImport("kernel32")] public static extern int GetNamedPipeHandleState(HANDLE hNamedPipe, ref int lpState, ref int lpCurInstances, ref int lpMaxCollectionCount, ref int lpCollectDataTimeout, string lpUserName, int nMaxUserNameSize); 983 [DllImport("kernel32")] public static extern int GetNamedPipeInfo(HANDLE hNamedPipe, ref int lpFlags, ref int lpOutBufferSize, ref int lpInBufferSize, ref int lpMaxInstances); 984 [DllImport("kernel32")] public static extern int GetNumberFormat(int Locale, int dwFlags, string lpValue, ref NUMBERFMT lpFormat, string lpNumberStr, int cchNumber); 985 [DllImport("kernel32")] public static extern int GetNumberOfConsoleInputEvents(HANDLE hConsoleInput, ref int lpNumberOfEvents); 986 [DllImport("kernel32")] public static extern int GetNumberOfConsoleMouseButtons(int lpNumberOfMouseButtons); 987 [DllImport("kernel32")] public static extern int GetOEMCP(); 988 [DllImport("kernel32")] public static extern int GetOverlappedResult(HANDLE hFile, ref OVERLAPPED lpOverlapped, ref int lpNumberOfBytesTransferred, int bWait); 989 [DllImport("kernel32")] public static extern int GetPriorityClass(HANDLE hProcess); 990 [DllImport("kernel32")] public static extern int GetPrivateProfileInt(string lpApplicationName, string lpKeyName, int nDefault, string lpFileName); 991 [DllImport("kernel32")] public static extern int GetPrivateProfileSection(string lpAppName, StringBuilder lpReturnedString, int nSize, string lpFileName); 992 [DllImport("kernel32")] public static extern int GetPrivateProfileString(string lpApplicationName, IntPtr lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName); 993 [DllImport("kernel32")] public static extern int GetPrivateProfileString(string lpApplicationName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName); 994 [DllImport("kernel32")] public static extern int GetProcessAffinityMask(HANDLE hProcess, ref int lpProcessAffinityMask, int SystemAffinityMask); 995 [DllImport("kernel32")] public static extern int GetProcessHeap(); 996 [DllImport("kernel32")] public static extern int GetProcessHeaps(int NumberOfHeaps, int ProcessHeaps); 997 [DllImport("kernel32")] public static extern int GetProcessShutdownParameters(int lpdwLevel, ref int lpdwFlags); 998 [DllImport("kernel32")] public static extern int GetProcessTimes(HANDLE hProcess, ref FILETIME lpCreationTime, ref FILETIME lpExitTime, ref FILETIME lpKernelTime, ref FILETIME lpUserTime); 999 [DllImport("kernel32")] public static extern int GetProcessWorkingSetSize(HANDLE hProcess, ref int lpMinimumWorkingSetSize, ref int lpMaximumWorkingSetSize); 1000 [DllImport("kernel32")] public static extern int GetProfileInt(string lpAppName, string lpKeyName, int nDefault); 1001 [DllImport("kernel32")] public static extern int GetProfileSection(string lpAppName, string lpReturnedString, int nSize); 1002 [DllImport("kernel32")] public static extern int GetProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize); 1003 [DllImport("kernel32")] public static extern int GetQueuedCompletionStatus(int CompletionPort, ref int lpNumberOfBytesTransferred, ref int lpCompletionKey, ref int lpOverlapped, int dwMilliseconds); 1004 [DllImport("kernel32")] public static extern int GetShortPathName(string lpszLongPath, string lpszShortPath, int cchBuffer); 1005 [DllImport("kernel32")] public static extern int GetStdHandle(int nStdHandle); 1006 [DllImport("kernel32")] public static extern int GetStringTypeA(int lcid, int dwInfoType, string lpSrcStr, int cchSrc, ref int lpCharType); 1007 [DllImport("kernel32")] public static extern int GetStringTypeEx(int Locale, int dwInfoType, string lpSrcStr, int cchSrc, short lpCharType); 1008 [DllImport("kernel32")] public static extern int GetStringTypeW(int dwInfoType, string lpSrcStr, int cchSrc, short lpCharType); 1009 [DllImport("kernel32")] public static extern int GetSystemDefaultLCID(); 1010 [DllImport("kernel32")] public static extern int GetSystemDirectory(StringBuilder lpBuffer, int nSize); 1011 [DllImport("kernel32")] public static extern int GetSystemPowerStatus(ref SYSTEM_POWER_STATUS lpSystemPowerStatus); 1012 [DllImport("kernel32")] public static extern int GetSystemTimeAdjustment(int lpTimeAdjustment, ref int lpTimeIncrement, ref int lpTimeAdjustmentDisabled); 1013 [DllImport("kernel32")] public static extern int GetTapeParameters(HANDLE hDevice, int dwOperation, ref int lpdwSize, IntPtr lpTapeInformation); 1014 [DllImport("kernel32")] public static extern int GetTapePosition(HANDLE hDevice, int dwPositionType, ref int lpdwPartition, ref int lpdwOffsetLow, ref int lpdwOffsetHigh); 1015 [DllImport("kernel32")] public static extern int GetTapeStatus(HANDLE hDevice); 1016 [DllImport("kernel32")] public static extern int GetTempFileName(string lpszPath, string lpPrefixString, int wUnique, StringBuilder lpTempFileName); 1017 [DllImport("kernel32")] public static extern int GetTempPath(int nBufferLength, StringBuilder lpBuffer); 1018 [DllImport("kernel32")] public static extern int GetThreadContext(HANDLE hThread, ref CONTEXT lpContext); 1019 [DllImport("kernel32")] public static extern int GetThreadPriority(HANDLE hThread); 1020 [DllImport("kernel32")] public static extern int GetThreadSelectorEntry(HANDLE hThread, int dwSelector, ref LDT_ENTRY lpSelectorEntry); 1021 [DllImport("kernel32")] public static extern int GetThreadTimes(HANDLE hThread, ref FILETIME lpCreationTime, ref FILETIME lpExitTime, ref FILETIME lpKernelTime, ref FILETIME lpUserTime); 1022 [DllImport("kernel32")] public static extern int GetTickCount(); 1023 [DllImport("kernel32")] public static extern int GetTimeFormat(int Locale, int dwFlags, ref SYSTEMTIME lpTime, string lpFormat, string lpTimeStr, int cchTime); 1024 [DllImport("kernel32")] public static extern int GetTimeZoneInformation(ref TIME_ZONE_INFORMATION lpTimeZoneInformation); 1025 [DllImport("kernel32")] public static extern int GetUserDefaultLCID(); 1026 [DllImport("kernel32")] public static extern int GetVersion(); 1027 [DllImport("kernel32")] public static extern int GetVersionEx(ref OSVERSIONINFO lpVersionInformation); 1028 [DllImport("kernel32")] public static extern int GetVolumeInformation(string lpRootPathName, string lpVolumeNameBuffer, int nVolumeNameSize, ref int lpVolumeSerialNumber, ref int lpMaximumComponentLength, ref int lpFileSystemFlags, string lpFileSystemNameBuffer, int nFileSystemNameSize); 1029 [DllImport("kernel32")] public static extern int GetWindowsDirectory(StringBuilder lpBuffer, int nSize); 1030 [DllImport("kernel32")] public static extern int GlobalAlloc(int wFlags, int dwBytes); 1031 [DllImport("kernel32")] public static extern int GlobalCompact(int dwMinFree); 1032 [DllImport("kernel32")] public static extern int GlobalFlags(HANDLE hMem); 1033 [DllImport("kernel32")] public static extern int GlobalFree(HANDLE hMem); 1034 [DllImport("kernel32")] public static extern int GlobalGetAtomName(short nAtom, string lpBuffer, int nSize); 1035 [DllImport("kernel32")] public static extern int GlobalHandle(IntPtr wMem); 1036 [DllImport("kernel32")] public static extern int GlobalLock(HANDLE hMem); 1037 [DllImport("kernel32")] public static extern int GlobalReAlloc(HANDLE hMem, int dwBytes, int wFlags); 1038 [DllImport("kernel32")] public static extern int GlobalSize(HANDLE hMem); 1039 [DllImport("kernel32")] public static extern int GlobalUnWire(HANDLE hMem); 1040 [DllImport("kernel32")] public static extern int GlobalUnlock(HANDLE hMem); 1041 [DllImport("kernel32")] public static extern int GlobalWire(HANDLE hMem); 1042 [DllImport("kernel32")] public static extern int HeapAlloc(HANDLE hHeap, int dwFlags, int dwBytes); 1043 [DllImport("kernel32")] public static extern int HeapCompact(HANDLE hHeap, int dwFlags); 1044 [DllImport("kernel32")] public static extern int HeapCreate(int flOptions, int dwInitialSize, int dwMaximumSize); 1045 [DllImport("kernel32")] public static extern int HeapDestroy(HANDLE hHeap); 1046 [DllImport("kernel32")] public static extern int HeapFree(HANDLE hHeap, int dwFlags, IntPtr lpMem); 1047 [DllImport("kernel32")] public static extern int HeapLock(HANDLE hHeap); 1048 [DllImport("kernel32")] public static extern int HeapReAlloc(HANDLE hHeap, int dwFlags, IntPtr lpMem, int dwBytes); 1049 [DllImport("kernel32")] public static extern int HeapSize(HANDLE hHeap, int dwFlags, IntPtr lpMem); 1050 [DllImport("kernel32")] public static extern int HeapUnlock(HANDLE hHeap); 1051 [DllImport("kernel32")] public static extern int HeapValidate(HANDLE hHeap, int dwFlags, IntPtr lpMem); 1052 [DllImport("kernel32")] public static extern int InitAtomTable(int nSize); 1053 [DllImport("kernel32")] public static extern int InterlockedDecrement(int lpAddend); 1054 [DllImport("kernel32")] public static extern int InterlockedExchange(int Target, int Value); 1055 [DllImport("kernel32")] public static extern int InterlockedIncrement(int lpAddend); 1056 [DllImport("kernel32")] public static extern int IsBadCodePtr(int lpfn); 1057 [DllImport("kernel32")] public static extern int IsBadHugeReadPtr(IntPtr lp, int ucb); 1058 [DllImport("kernel32")] public static extern int IsBadHugeWritePtr(IntPtr lp, int ucb); 1059 [DllImport("kernel32")] public static extern int IsBadReadPtr(IntPtr lp, int ucb); 1060 [DllImport("kernel32")] public static extern int IsBadStringPtr(string lpsz, int ucchMax); 1061 [DllImport("kernel32")] public static extern int IsBadWritePtr(IntPtr lp, int ucb); 1062 [DllImport("kernel32")] public static extern int IsDBCSLeadByte(Byte bTestChar); 1063 [DllImport("kernel32")] public static extern int IsValidCodePage(int CodePage); 1064 [DllImport("kernel32")] public static extern int LCMapString(int Locale, int dwMapFlags, string lpSrcStr, int cchSrc, string lpDestStr, int cchDest); 1065 [DllImport("kernel32")] public static extern int LoadLibrary(string lpLibFileName); 1066 [DllImport("kernel32")] public static extern int LoadLibraryEx(string lpLibFileName, HANDLE hFile, int dwFlags); 1067 [DllImport("kernel32")] public static extern int LoadModule(string lpModuleName, IntPtr lpParameterBlock); 1068 [DllImport("kernel32")] public static extern int LoadResource(HANDLE hInstance, HANDLE hResInfo); 1069 [DllImport("kernel32")] public static extern int LocalAlloc(int wFlags, int wBytes); 1070 [DllImport("kernel32")] public static extern int LocalCompact(int uMinFree); 1071 [DllImport("kernel32")] public static extern int LocalFileTimeToFileTime(ref FILETIME lpLocalFileTime, ref FILETIME lpFileTime); 1072 [DllImport("kernel32")] public static extern int LocalFlags(HANDLE hMem); 1073 [DllImport("kernel32")] public static extern int LocalFree(HANDLE hMem); 1074 [DllImport("kernel32")] public static extern int LocalHandle(HANDLE hMem); 1075 [DllImport("kernel32")] public static extern int LocalLock(HANDLE hMem); 1076 [DllImport("kernel32")] public static extern int LocalReAlloc(HANDLE hMem, int wBytes, int wFlags); 1077 [DllImport("kernel32")] public static extern int LocalShrink(HANDLE hMem, int cbNewSize); 1078 [DllImport("kernel32")] public static extern int LocalSize(HANDLE hMem); 1079 [DllImport("kernel32")] public static extern int LocalUnlock(HANDLE hMem); 1080 [DllImport("kernel32")] public static extern int LockFile(HANDLE hFile, int dwFileOffsetLow, int dwFileOffsetHigh, int nNumberOfBytesToLockLow, int nNumberOfBytesToLockHigh); 1081 [DllImport("kernel32")] public static extern int LockFileEx(HANDLE hFile, int dwFlags, int dwReserved, int nNumberOfBytesToLockLow, int nNumberOfBytesToLockHigh, ref OVERLAPPED lpOverlapped); 1082 [DllImport("kernel32")] public static extern int LockResource(HANDLE hResData); 1083 [DllImport("kernel32")] public static extern int MapViewOfFile(HANDLE hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap); 1084 [DllImport("kernel32")] public static extern int MapViewOfFileEx(HANDLE hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap, IntPtr lpBaseAddress); 1085 [DllImport("kernel32")] public static extern int MoveFile(string lpExistingFileName, string lpNewFileName); 1086 [DllImport("kernel32")] public static extern int MoveFileEx(string lpExistingFileName, string lpNewFileName, int dwFlags); 1087 [DllImport("kernel32")] public static extern int MulDiv(int nNumber, int nNumerator, int nDenominator); 1088 [DllImport("kernel32")] public static extern int MultiByteToWideChar(int CodePage, int dwFlags, string lpMultiByteStr, int cchMultiByte, string lpWideCharStr, int cchWideChar); 1089 [DllImport("kernel32")] public static extern int OpenEvent(int dwDesiredAccess, int bInheritHandle, string lpName); 1090 [DllImport("kernel32")] public static extern int OpenFile(string lpFileName, ref OFSTRUCT lpReOpenBuff, int wStyle); 1091 [DllImport("kernel32")] public static extern int OpenFileMapping(int dwDesiredAccess, int bInheritHandle, string lpName); 1092 [DllImport("kernel32")] public static extern int OpenMutex(int dwDesiredAccess, int bInheritHandle, string lpName); 1093 [DllImport("kernel32")] public static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId); 1094 [DllImport("kernel32")] public static extern int OpenSemaphore(int dwDesiredAccess, int bInheritHandle, string lpName); 1095 [DllImport("kernel32")] public static extern int PeekNamedPipe(HANDLE hNamedPipe, IntPtr lpBuffer, int nBufferSize, ref int lpBytesRead, ref int lpTotalBytesAvail, ref int lpBytesLeftThisMessage); 1096 [DllImport("kernel32")] public static extern int PrepareTape(HANDLE hDevice, int dwOperation, int bimmediate); 1097 [DllImport("kernel32")] public static extern int PulseEvent(HANDLE hEvent); 1098 [DllImport("kernel32")] public static extern int PurgeComm(HANDLE hFile, int dwFlags); 1099 [DllImport("kernel32")] public static extern int QueryDosDevice(string lpDeviceName, string lpTargetPath, int ucchMax); 1100 [DllImport("kernel32")] public static extern int QueryPerformanceCounter(ref LARGE_INTEGER lpPerformanceCount); 1101 [DllImport("kernel32")] public static extern int QueryPerformanceFrequency(ref LARGE_INTEGER lpFrequency); 1102 [DllImport("kernel32")] public static extern int ReadConsole(HANDLE hConsoleInput, IntPtr lpBuffer, int nNumberOfCharsToRead, ref int lpNumberOfCharsRead, IntPtr lpReserved); 1103 [DllImport("kernel32")] public static extern int ReadConsoleOutput(HANDLE hConsoleOutput, ref CHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, ref SMALL_RECT lpReadRegion); 1104 [DllImport("kernel32")] public static extern int ReadConsoleOutputAttribute(HANDLE hConsoleOutput, ref int lpAttribute, int nLength, COORD dwReadCoord, ref int lpNumberOfAttrsRead); 1105 [DllImport("kernel32")] public static extern int ReadConsoleOutputCharacter(HANDLE hConsoleOutput, string lpCharacter, int nLength, COORD dwReadCoord, ref int lpNumberOfCharsRead); 1106 [DllImport("kernel32")] public static extern int ReadFile(HANDLE hFile, IntPtr lpBuffer, int nNumberOfBytesToRead, ref int lpNumberOfBytesRead, ref OVERLAPPED lpOverlapped); 1107 [DllImport("kernel32")] public static extern int ReadFileEx(HANDLE hFile, IntPtr lpBuffer, int nNumberOfBytesToRead, ref OVERLAPPED lpOverlapped, ref int lpCompletionRoutine); 1108 [DllImport("kernel32")] public static extern int ReadProcessMemory(HANDLE hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer, int nSize, ref int lpNumberOfBytesWritten); 1109 [DllImport("kernel32")] public static extern int ReleaseMutex(HANDLE hMutex); 1110 [DllImport("kernel32")] public static extern int ReleaseSemaphore(HANDLE hSemaphore, int lReleaseCount, ref int lpPreviousCount); 1111 [DllImport("kernel32")] public static extern int RemoveDirectory(string lpPathName); 1112 [DllImport("kernel32")] public static extern int ResetEvent(HANDLE hEvent); 1113 [DllImport("kernel32")] public static extern int ResumeThread(HANDLE hThread); 1114 [DllImport("kernel32")] public static extern int ScrollConsoleScreenBuffer(HANDLE hConsoleOutput, ref SMALL_RECT lpScrollRectangle, ref SMALL_RECT lpClipRectangle, COORD dwDestinationOrigin, ref CHAR_INFO lpFill); 1115 [DllImport("kernel32")] public static extern int SearchPath(string lpPath, string lpFileName, string lpExtension, int nBufferLength, string lpBuffer, string lpFilePart); 1116 [DllImport("kernel32")] public static extern int SetCommBreak(int nCid); 1117 [DllImport("kernel32")] public static extern int SetCommConfig(HANDLE hCommDev, ref COMMCONFIG lpCC, int dwSize); 1118 [DllImport("kernel32")] public static extern int SetCommMask(HANDLE hFile, int dwEvtMask); 1119 [DllImport("kernel32")] public static extern int SetCommState(HANDLE hCommDev, ref DCB lpDCB); 1120 [DllImport("kernel32")] public static extern int SetCommTimeouts(HANDLE hFile, ref COMMTIMEOUTS lpCommTimeouts); 1121 [DllImport("kernel32")] public static extern int SetComputerName(string lpComputerName); 1122 [DllImport("kernel32")] public static extern int SetConsoleActiveScreenBuffer(HANDLE hConsoleOutput); 1123 [DllImport("kernel32")] public static extern int SetConsoleCP(int wCodePageID); 1124 [DllImport("kernel32")] public static extern int SetConsoleCtrlHandler(int HandlerRoutine, int Add); 1125 [DllImport("kernel32")] public static extern int SetConsoleCursorInfo(HANDLE hConsoleOutput, ref CONSOLE_CURSOR_INFO lpConsoleCursorInfo); 1126 [DllImport("kernel32")] public static extern int SetConsoleCursorPosition(HANDLE hConsoleOutput, COORD dwCursorPosition); 1127 [DllImport("kernel32")] public static extern int SetConsoleMode(HANDLE hConsoleHandle, int dwMode); 1128 [DllImport("kernel32")] public static extern int SetConsoleOutputCP(int wCodePageID); 1129 [DllImport("kernel32")] public static extern int SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize); 1130 [DllImport("kernel32")] public static extern int SetConsoleTextAttribute(HANDLE hConsoleOutput, int wAttributes); 1131 [DllImport("kernel32")] public static extern int SetConsoleTitle(string lpConsoleTitle); 1132 [DllImport("kernel32")] public static extern int SetConsoleWindowInfo(HANDLE hConsoleOutput, int bAbsolute, ref SMALL_RECT lpConsoleWindow); 1133 [DllImport("kernel32")] public static extern int SetCurrentDirectory(string lpPathName); 1134 [DllImport("kernel32")] public static extern int SetDefaultCommConfig(string lpszName, ref COMMCONFIG lpCC, int dwSize); 1135 [DllImport("kernel32")] public static extern int SetEndOfFile(HANDLE hFile); 1136 [DllImport("kernel32")] public static extern int SetEnvironmentVariable(string lpName, string lpValue); 1137 [DllImport("kernel32")] public static extern int SetErrorMode(int wMode); 1138 [DllImport("kernel32")] public static extern int SetEvent(HANDLE hEvent); 1139 [DllImport("kernel32")] public static extern int SetFileAttributes(string lpFileName, int dwFileAttributes); 1140 [DllImport("kernel32")] public static extern int SetFilePointer(HANDLE hFile, int lDistanceToMove, ref int lpDistanceToMoveHigh, int dwMoveMethod); 1141 [DllImport("kernel32")] public static extern int SetFileTime(HANDLE hFile, ref FILETIME lpCreationTime, ref FILETIME lpLastAccessTime, ref FILETIME lpLastWriteTime); 1142 [DllImport("kernel32")] public static extern int SetHandleCount(int wNumber); 1143 [DllImport("kernel32")] public static extern int SetHandleInformation(HANDLE hObject, int dwMask, int dwFlags); 1144 [DllImport("kernel32")] public static extern int SetLocalTime(ref SYSTEMTIME lpSystemTime); 1145 [DllImport("kernel32")] public static extern int SetLocaleInfo(int Locale, int LCType, string lpLCData); 1146 [DllImport("kernel32")] public static extern int SetMailslotInfo(HANDLE hMailslot, int lReadTimeout); 1147 [DllImport("kernel32")] public static extern int SetNamedPipeHandleState(HANDLE hNamedPipe, ref int lpMode, ref int lpMaxCollectionCount, ref int lpCollectDataTimeout); 1148 [DllImport("kernel32")] public static extern int SetPriorityClass(HANDLE hProcess, int dwPriorityClass); 1149 [DllImport("kernel32")] public static extern int SetProcessShutdownParameters(int dwLevel, int dwFlags); 1150 [DllImport("kernel32")] public static extern int SetProcessWorkingSetSize(HANDLE hProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize); 1151 [DllImport("kernel32")] public static extern int SetStdHandle(int nStdHandle, int nHandle); 1152 [DllImport("kernel32")] public static extern int SetSystemPowerState(int fSuspend, int fForce); 1153 [DllImport("kernel32")] public static extern int SetSystemTime(ref SYSTEMTIME lpSystemTime); 1154 [DllImport("kernel32")] public static extern int SetTapeParameters(HANDLE hDevice, int dwOperation, IntPtr lpTapeInformation); 1155 [DllImport("kernel32")] public static extern int SetTapePosition(HANDLE hDevice, int dwPositionMethod, int dwPartition, int dwOffsetLow, int dwOffsetHigh, int bimmediate); 1156 [DllImport("kernel32")] public static extern int SetThreadAffinityMask(HANDLE hThread, int dwThreadAffinityMask); 1157 [DllImport("kernel32")] public static extern int SetThreadContext(HANDLE hThread, ref CONTEXT lpContext); 1158 [DllImport("kernel32")] public static extern int SetThreadLocale(int Locale); 1159 [DllImport("kernel32")] public static extern int SetThreadPriority(HANDLE hThread, int nPriority); 1160 [DllImport("kernel32")] public static extern int SetTimeZoneInformation(ref TIME_ZONE_INFORMATION lpTimeZoneInformation); 1161 [DllImport("kernel32")] public static extern int SetUnhandledExceptionFilter(int lpTopLevelExceptionFilter); 1162 [DllImport("kernel32")] public static extern int SetVolumeLabel(string lpRootPathName, string lpVolumeName); 1163 [DllImport("kernel32")] public static extern int SetupComm(HANDLE hFile, int dwInQueue, int dwOutQueue); 1164 [DllImport("kernel32")] public static extern int SizeofResource(HANDLE hInstance, HANDLE hResInfo); 1165 [DllImport("kernel32")] public static extern int SleepEx(int dwMilliseconds, int bAlertable); 1166 [DllImport("kernel32")] public static extern int SuspendThread(HANDLE hThread); 1167 [DllImport("kernel32")] public static extern int SystemTimeToFileTime(ref SYSTEMTIME lpSystemTime, ref FILETIME lpFileTime); 1168 [DllImport("kernel32")] public static extern int SystemTimeToTzSpecificLocalTime(ref TIME_ZONE_INFORMATION lpTimeZoneInformation, ref SYSTEMTIME lpUniversalTime, ref SYSTEMTIME lpLocalTime); 1169 [DllImport("kernel32")] public static extern int TerminateProcess(HANDLE hProcess, int uExitCode); 1170 [DllImport("kernel32")] public static extern int TerminateThread(HANDLE hThread, int dwExitCode); 1171 [DllImport("kernel32")] public static extern int TlsAlloc(); 1172 [DllImport("kernel32")] public static extern int TlsFree(int dwTlsIndex); 1173 [DllImport("kernel32")] public static extern int TlsGetValue(int dwTlsIndex); 1174 [DllImport("kernel32")] public static extern int TlsSetValue(int dwTlsIndex, IntPtr lpTlsValue); 1175 [DllImport("kernel32")] public static extern int TransactNamedPipe(HANDLE hNamedPipe, IntPtr lpInBuffer, int nInBufferSize, IntPtr lpOutBuffer, int nOutBufferSize, ref int lpBytesRead, ref OVERLAPPED lpOverlapped); 1176 [DllImport("kernel32")] public static extern int TransmitCommChar(int nCid, Byte cChar); 1177 [DllImport("kernel32")] public static extern int UnhandledExceptionFilter(ref EXCEPTION_POINTERS ExceptionInfo); 1178 [DllImport("kernel32")] public static extern int UnlockFile(HANDLE hFile, int dwFileOffsetLow, int dwFileOffsetHigh, int nNumberOfBytesToUnlockLow, int nNumberOfBytesToUnlockHigh); 1179 [DllImport("kernel32")] public static extern int UnlockFileEx(HANDLE hFile, int dwReserved, int nNumberOfBytesToUnlockLow, int nNumberOfBytesToUnlockHigh, ref OVERLAPPED lpOverlapped); 1180 [DllImport("kernel32")] public static extern int UnmapViewOfFile(IntPtr lpBaseAddress); 1181 [DllImport("kernel32")] public static extern int UpdateResource(HANDLE hUpdate, string lpType, string lpName, int wLanguage, IntPtr lpData, int cbData); 1182 [DllImport("kernel32")] public static extern int VerLanguageName(int wLang, string szLang, int nSize); 1183 [DllImport("kernel32")] public static extern int VirtualAlloc(IntPtr lpAddress, int dwSize, int flAllocationType, int flProtect); 1184 [DllImport("kernel32")] public static extern int VirtualFree(IntPtr lpAddress, int dwSize, int dwFreeType); 1185 [DllImport("kernel32")] public static extern int VirtualLock(IntPtr lpAddress, int dwSize); 1186 [DllImport("kernel32")] public static extern int VirtualProtect(IntPtr lpAddress, int dwSize, int flNewProtect, ref int lpflOldProtect); 1187 [DllImport("kernel32")] public static extern int VirtualProtectEx(HANDLE hProcess, IntPtr lpAddress, int dwSize, int flNewProtect, ref int lpflOldProtect); 1188 [DllImport("kernel32")] public static extern int VirtualQuery(IntPtr lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, int dwLength); 1189 [DllImport("kernel32")] public static extern int VirtualQueryEx(HANDLE hProcess, IntPtr lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, int dwLength); 1190 [DllImport("kernel32")] public static extern int VirtualUnlock(IntPtr lpAddress, int dwSize); 1191 [DllImport("kernel32")] public static extern int WaitCommEvent(HANDLE hFile, ref int lpEvtMask, ref OVERLAPPED lpOverlapped); 1192 [DllImport("kernel32")] public static extern int WaitForMultipleObjects(int nCount, ref int lpHandles, int bWaitAll, int dwMilliseconds); 1193 [DllImport("kernel32")] public static extern int WaitForMultipleObjectsEx(int nCount, ref int lpHandles, int bWaitAll, int dwMilliseconds, int bAlertable); 1194 [DllImport("kernel32")] public static extern int WaitForSingleObject(HANDLE hHandle, int dwMilliseconds); 1195 [DllImport("kernel32")] public static extern int WaitForSingleObjectEx(HANDLE hHandle, int dwMilliseconds, int bAlertable); 1196 [DllImport("kernel32")] public static extern int WaitNamedPipe(string lpNamedPipeName, int nTimeOut); 1197 [DllImport("kernel32")] public static extern int WideCharToMultiByte(int CodePage, int dwFlags, string lpWideCharStr, int cchWideChar, string lpMultiByteStr, int cchMultiByte, string lpDefaultChar, ref int lpUsedDefaultChar); 1198 [DllImport("kernel32")] public static extern int WinExec(string lpCmdLine, int nCmdShow); 1199 [DllImport("kernel32")] public static extern int WriteConsole(HANDLE hConsoleOutput, IntPtr lpBuffer, int nNumberOfCharsToWrite, ref int lpNumberOfCharsWritten, IntPtr lpReserved); 1200 [DllImport("kernel32")] public static extern int WriteConsoleOutput(HANDLE hConsoleOutput, ref CHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, ref SMALL_RECT lpWriteRegion); 1201 [DllImport("kernel32")] public static extern int WriteConsoleOutputAttribute(HANDLE hConsoleOutput, short lpAttribute, int nLength, COORD dwWriteCoord, ref int lpNumberOfAttrsWritten); 1202 [DllImport("kernel32")] public static extern int WriteConsoleOutputCharacter(HANDLE hConsoleOutput, string lpCharacter, int nLength, COORD dwWriteCoord, ref int lpNumberOfCharsWritten); 1203 [DllImport("kernel32")] public static extern int WriteFile(HANDLE hFile, IntPtr lpBuffer, int nNumberOfBytesToWrite, ref int lpNumberOfBytesWritten, ref OVERLAPPED lpOverlapped); 1204 [DllImport("kernel32")] public static extern int WriteFileEx(HANDLE hFile, IntPtr lpBuffer, int nNumberOfBytesToWrite, ref OVERLAPPED lpOverlapped, ref int lpCompletionRoutine); 1205 [DllImport("kernel32")] public static extern int WritePrivateProfileSection(string lpAppName, string lpString, string lpFileName); 1206 [DllImport("kernel32")] public static extern int WritePrivateProfileString(string lpApplicationName, IntPtr lpKeyName, IntPtr lpString, string lpFileName); 1207 [DllImport("kernel32")] public static extern int WritePrivateProfileString(string lpApplicationName, string lpKeyName, IntPtr lpString, string lpFileName); 1208 [DllImport("kernel32")] public static extern int WriteProcessMemory(HANDLE hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer, int nSize, ref int lpNumberOfBytesWritten); 1209 [DllImport("kernel32")] public static extern int WriteProfileSection(string lpAppName, string lpString); 1210 [DllImport("kernel32")] public static extern int WriteProfileString(string lpszSection, string lpszKeyName, string lpszString); 1211 [DllImport("kernel32")] public static extern int WriteTapemark(HANDLE hDevice, int dwTapemarkType, int dwTapemarkCount, int bimmediate); 1212 [DllImport("kernel32")] public static extern int hread(HANDLE hFile, IntPtr lpBuffer, int lBytes); 1213 [DllImport("kernel32")] public static extern int hwrite(HANDLE hFile, string lpBuffer, int lBytes); 1214 [DllImport("kernel32")] public static extern int lclose(HANDLE hFile); 1215 [DllImport("kernel32")] public static extern int lcreat(string lpPathName, int iAttribute); 1216 [DllImport("kernel32")] public static extern int llseek(HANDLE hFile, int lOffset, int iOrigin); 1217 [DllImport("kernel32")] public static extern int lopen(string lpPathName, int iReadWrite); 1218 [DllImport("kernel32")] public static extern int lread(HANDLE hFile, IntPtr lpBuffer, int wBytes); 1219 [DllImport("kernel32")] public static extern int lstrcat(string lpString1, string lpString2); 1220 [DllImport("kernel32")] public static extern int lstrcmp(string lpString1, string lpString2); 1221 [DllImport("kernel32")] public static extern int lstrcmpi(string lpString1, string lpString2); 1222 [DllImport("kernel32")] public static extern int lstrcpy(string lpString1, string lpString2); 1223 [DllImport("kernel32")] public static extern int lstrcpyn(string lpString1, string lpString2, int iMaxLength); 1224 [DllImport("kernel32")] public static extern int lstrlen(string lpString); 1225 [DllImport("kernel32")] public static extern int lwrite(HANDLE hFile, string lpBuffer, int wBytes); 1226 [DllImport("kernel32")] public static extern short GetSystemDefaultLangID(); 1227 [DllImport("kernel32")] public static extern short GetUserDefaultLangID(); 1228 [DllImport("kernel32")] public static extern short GlobalAddAtom(string lpString); 1229 [DllImport("kernel32")] public static extern short GlobalDeleteAtom(short nAtom); 1230 [DllImport("kernel32")] public static extern short GlobalFindAtom(string lpString); 1231 [DllImport("kernel32")] public static extern string GetEnvironmentStrings(); 1232 [DllImport("kernel32")] public static extern void CopyMemory(IntPtr Destination, IntPtr Source, int Length); 1233 [DllImport("kernel32")] public static extern void DebugBreak(); 1234 [DllImport("kernel32")] public static extern void DeleteCriticalSection(ref CRITICAL_SECTION lpCriticalSection); 1235 [DllImport("kernel32")] public static extern void EnterCriticalSection(ref CRITICAL_SECTION lpCriticalSection); 1236 [DllImport("kernel32")] public static extern void ExitProcess(int uExitCode); 1237 [DllImport("kernel32")] public static extern void ExitThread(int dwExitCode); 1238 [DllImport("kernel32")] public static extern void FatalAppExit(int uAction, string lpMessageText); 1239 [DllImport("kernel32")] public static extern void FatalExit(int code); 1240 [DllImport("kernel32")] public static extern void FreeLibraryAndExitThread(HANDLE hLibModule, int dwExitCode); 1241 [DllImport("kernel32")] public static extern void GetLocalTime(ref SYSTEMTIME lpSystemTime); 1242 [DllImport("kernel32")] public static extern void GetStartupInfo(ref STARTUPINFO lpStartupInfo); 1243 [DllImport("kernel32")] public static extern void GetSystemInfo(ref SYSTEM_INFO lpSystemInfo); 1244 [DllImport("kernel32")] public static extern void GetSystemTime(ref SYSTEMTIME lpSystemTime); 1245 [DllImport("kernel32")] public static extern void GlobalFix(HANDLE hMem); 1246 [DllImport("kernel32")] public static extern void GlobalMemoryStatus(ref MEMORYSTATUS lpBuffer); 1247 [DllImport("kernel32")] public static extern void GlobalUnfix(HANDLE hMem); 1248 [DllImport("kernel32")] public static extern void InitializeCriticalSection(ref CRITICAL_SECTION lpCriticalSection); 1249 [DllImport("kernel32")] public static extern void LeaveCriticalSection(ref CRITICAL_SECTION lpCriticalSection); 1250 [DllImport("kernel32")] public static extern void RaiseException(int dwExceptionCode, int dwExceptionFlags, int nNumberOfArguments, ref int lpArguments); 1251 [DllImport("kernel32")] public static extern void SetFileApisToANSI(); 1252 [DllImport("kernel32")] public static extern void SetFileApisToOEM(); 1253 [DllImport("kernel32")] public static extern void SetLastError(int dwErrCode); 1254 [DllImport("kernel32")] public static extern void Sleep(int dwMilliseconds); 1255 [DllImport("kernel32")] public static extern int GetComputerNameW(IntPtr lpBuffer, int nSize); 1256 [DllImport("kernel32")] public static extern int GetProcAddress(HANDLE hModule, string lpProcName); 1257 1258 public const int ACCESS_ALLOWED_ACE_TYPE = 0x0; 1259 public const int ACCESS_DENIED_ACE_TYPE = 0x1; 1260 public const int ACCESS_SYSTEM_SECURITY = 0x1000000; 1261 public const int ACL_REVISION = (2); 1262 public const int ACL_REVISION1 = (1); 1263 public const int ACL_REVISION2 = (2); 1264 public const int AC_LINE_BACKUP_POWER = 0x2; 1265 public const int AC_LINE_OFFLINE = 0x0; 1266 public const int AC_LINE_ONLINE = 0x1; 1267 public const int AC_LINE_UNKNOWN = 0xFF; 1268 public const int APPLICATION_ERROR_MASK = 0x20000000; 1269 public const int AclRevisionInformation = 1; 1270 public const int AclSizeInformation = 2; 1271 public const int BACKGROUND_BLUE = 0x10; 1272 public const int BACKGROUND_GREEN = 0x20; 1273 public const int BACKGROUND_INTENSITY = 0x80; 1274 public const int BACKGROUND_RED = 0x40; 1275 public const int BACKUP_ALTERNATE_DATA = 0x4; 1276 public const int BACKUP_DATA = 0x1; 1277 public const int BACKUP_EA_DATA = 0x2; 1278 public const int BACKUP_LINK = 0x5; 1279 public const int BACKUP_SECURITY_DATA = 0x3; 1280 public const int BATTERY_FLAG_CHARGING = 0x8; 1281 public const int BATTERY_FLAG_CRITICAL = 0x4; 1282 public const int BATTERY_FLAG_HIGH = 0x1; 1283 public const int BATTERY_FLAG_LOW = 0x2; 1284 public const int BATTERY_FLAG_NO_BATTERY = 0x80; 1285 public const int BATTERY_FLAG_UNKNOWN = 0xFF; 1286 public const int BATTERY_LIFE_UNKNOWN = 0xFFFF; 1287 public const int BATTERY_PERCENTAGE_UNKNOWN = 0xFF; 1288 public const int BAUD_075 = 0x1; 1289 public const int BAUD_110 = 0x2; 1290 public const int BAUD_115200 = 0x20000; 1291 public const int BAUD_1200 = 0x40; 1292 public const int BAUD_128K = 0x10000; 1293 public const int BAUD_134_5 = 0x4; 1294 public const int BAUD_14400 = 0x1000; 1295 public const int BAUD_150 = 0x8; 1296 public const int BAUD_1800 = 0x80; 1297 public const int BAUD_19200 = 0x2000; 1298 public const int BAUD_2400 = 0x100; 1299 public const int BAUD_300 = 0x10; 1300 public const int BAUD_38400 = 0x4000; 1301 public const int BAUD_4800 = 0x200; 1302 public const int BAUD_56K = 0x8000; 1303 public const int BAUD_57600 = 0x40000; 1304 public const int BAUD_600 = 0x20; 1305 public const int BAUD_7200 = 0x400; 1306 public const int BAUD_9600 = 0x800; 1307 public const int BAUD_USER = 0x10000000; 1308 public const int C1_ALPHA = 0x100; 1309 public const int C1_BLANK = 0x40; 1310 public const int C1_CNTRL = 0x20; 1311 public const int C1_DIGIT = 0x4; 1312 public const int C1_LOWER = 0x2; 1313 public const int C1_PUNCT = 0x10; 1314 public const int C1_SPACE = 0x8; 1315 public const int C1_UPPER = 0x1; 1316 public const int C1_XDIGIT = 0x80; 1317 public const int C2_ARABICNUMBER = 0x6; 1318 public const int C2_BLOCKSEPARATOR = 0x8; 1319 public const int C2_COMMONSEPARATOR = 0x7; 1320 public const int C2_EUROPENUMBER = 0x3; 1321 public const int C2_EUROPESEPARATOR = 0x4; 1322 public const int C2_EUROPETERMINATOR = 0x5; 1323 public const int C2_LEFTTORIGHT = 0x1; 1324 public const int C2_NOTAPPLICABLE = 0x0; 1325 public const int C2_OTHERNEUTRAL = 0xB; 1326 public const int C2_RIGHTTOLEFT = 0x2; 1327 public const int C2_SEGMENTSEPARATOR = 0x9; 1328 public const int C2_WHITESPACE = 0xA; 1329 public const int C3_DIACRITIC = 0x2; 1330 public const int C3_NONSPACING = 0x1; 1331 public const int C3_NOTAPPLICABLE = 0x0; 1332 public const int C3_SYMBOL = 0x8; 1333 public const int C3_VOWELMARK = 0x4; 1334 public const int CAL_GREGORIAN = 1; 1335 public const int CAL_GREGORIAN_US = 2; 1336 public const int CAL_ICALINTVALUE = 0x1; 1337 public const int CAL_IYEAROFFSETRANGE = 0x3; 1338 public const int CAL_JAPAN = 3; 1339 public const int CAL_KOREA = 5; 1340 public const int CAL_SABBREVDAYNAME1 = 0xE; 1341 public const int CAL_SABBREVDAYNAME2 = 0xF; 1342 public const int CAL_SABBREVDAYNAME3 = 0x10; 1343 public const int CAL_SABBREVDAYNAME4 = 0x11; 1344 public const int CAL_SABBREVDAYNAME5 = 0x12; 1345 public const int CAL_SABBREVDAYNAME6 = 0x13; 1346 public const int CAL_SABBREVDAYNAME7 = 0x14; 1347 public const int CAL_SABBREVMONTHNAME1 = 0x22; 1348 public const int CAL_SABBREVMONTHNAME10 = 0x2B; 1349 public const int CAL_SABBREVMONTHNAME11 = 0x2C; 1350 public const int CAL_SABBREVMONTHNAME12 = 0x2D; 1351 public const int CAL_SABBREVMONTHNAME13 = 0x2E; 1352 public const int CAL_SABBREVMONTHNAME2 = 0x23; 1353 public const int CAL_SABBREVMONTHNAME3 = 0x24; 1354 public const int CAL_SABBREVMONTHNAME4 = 0x25; 1355 public const int CAL_SABBREVMONTHNAME5 = 0x26; 1356 public const int CAL_SABBREVMONTHNAME6 = 0x27; 1357 public const int CAL_SABBREVMONTHNAME7 = 0x28; 1358 public const int CAL_SABBREVMONTHNAME8 = 0x29; 1359 public const int CAL_SABBREVMONTHNAME9 = 0x2A; 1360 public const int CAL_SCALNAME = 0x2; 1361 public const int CAL_SDAYNAME1 = 0x7; 1362 public const int CAL_SDAYNAME2 = 0x8; 1363 public const int CAL_SDAYNAME3 = 0x9; 1364 public const int CAL_SDAYNAME4 = 0xA; 1365 public const int CAL_SDAYNAME5 = 0xB; 1366 public const int CAL_SDAYNAME6 = 0xC; 1367 public const int CAL_SDAYNAME7 = 0xD; 1368 public const int CAL_SERASTRING = 0x4; 1369 public const int CAL_SLONGDATE = 0x6; 1370 public const int CAL_SMONTHNAME1 = 0x15; 1371 public const int CAL_SMONTHNAME10 = 0x1E; 1372 public const int CAL_SMONTHNAME11 = 0x1F; 1373 public const int CAL_SMONTHNAME12 = 0x20; 1374 public const int CAL_SMONTHNAME13 = 0x21; 1375 public const int CAL_SMONTHNAME2 = 0x16; 1376 public const int CAL_SMONTHNAME3 = 0x17; 1377 public const int CAL_SMONTHNAME4 = 0x18; 1378 public const int CAL_SMONTHNAME5 = 0x19; 1379 public const int CAL_SMONTHNAME6 = 0x1A; 1380 public const int CAL_SMONTHNAME7 = 0x1B; 1381 public const int CAL_SMONTHNAME8 = 0x1C; 1382 public const int CAL_SMONTHNAME9 = 0x1D; 1383 public const int CAL_SSHORTDATE = 0x5; 1384 public const int CAL_TAIWAN = 4; 1385 public const int CAPSLOCK_ON = 0x80; 1386 public const int CBR_110 = 110; 1387 public const int CBR_115200 = 115200; 1388 public const int CBR_1200 = 1200; 1389 public const int CBR_128000 = 128000; 1390 public const int CBR_14400 = 14400; 1391 public const int CBR_19200 = 19200; 1392 public const int CBR_2400 = 2400; 1393 public const int CBR_256000 = 256000; 1394 public const int CBR_300 = 300; 1395 public const int CBR_38400 = 38400; 1396 public const int CBR_4800 = 4800; 1397 public const int CBR_56000 = 56000; 1398 public const int CBR_57600 = 57600; 1399 public const int CBR_600 = 600; 1400 public const int CBR_9600 = 9600; 1401 public const int CE_BREAK = 0x10; 1402 public const int CE_DNS = 0x800; 1403 public const int CE_FRAME = 0x8; 1404 public const int CE_IOE = 0x400; 1405 public const int CE_MODE = 0x8000; 1406 public const int CE_OOP = 0x1000; 1407 public const int CE_OVERRUN = 0x2; 1408 public const int CE_PTO = 0x200; 1409 public const int CE_RXOVER = 0x1; 1410 public const int CE_RXPARITY = 0x4; 1411 public const int CE_TXFULL = 0x100; 1412 public const int CLRBREAK = 9; 1413 public const int CLRDTR = 6; 1414 public const int CLRRTS = 4; 1415 public const int CONSOLE_TEXTMODE_BUFFER = 1; 1416 public const int CONTAINER_INHERIT_ACE = 0x2; 1417 public const int CP_ACP = 0; 1418 public const int CP_OEMCP = 1; 1419 public const int CREATE_ALWAYS = 2; 1420 public const int CREATE_NEW = 1; 1421 public const int CREATE_NEW_CONSOLE = 0x10; 1422 public const int CREATE_NEW_PROCESS_GROUP = 0x200; 1423 public const int CREATE_NO_WINDOW = 0x8000000; 1424 public const int CREATE_PROCESS_DEBUG_EVENT = 3; 1425 public const int CREATE_SUSPENDED = 0x4; 1426 public const int CREATE_THREAD_DEBUG_EVENT = 2; 1427 public const int CTRL_BREAK_EVENT = 1; 1428 public const int CTRL_CLOSE_EVENT = 2; 1429 public const int CTRL_C_EVENT = 0; 1430 public const int CTRL_LOGOFF_EVENT = 5; 1431 public const int CTRL_SHUTDOWN_EVENT = 6; 1432 public const int CTRY_AUSTRALIA = 61; 1433 public const int CTRY_AUSTRIA = 43; 1434 public const int CTRY_BELGIUM = 32; 1435 public const int CTRY_BRAZIL = 55; 1436 public const int CTRY_CANADA = 2; 1437 public const int CTRY_DEFAULT = 0; 1438 public const int CTRY_DENMARK = 45; 1439 public const int CTRY_FINLAND = 358; 1440 public const int CTRY_FRANCE = 33; 1441 public const int CTRY_GERMANY = 49; 1442 public const int CTRY_ICELAND = 354; 1443 public const int CTRY_IRELAND = 353; 1444 public const int CTRY_ITALY = 39; 1445 public const int CTRY_JAPAN = 81; 1446 public const int CTRY_MEXICO = 52; 1447 public const int CTRY_NETHERLANDS = 31; 1448 public const int CTRY_NEW_ZEALAND = 64; 1449 public const int CTRY_NORWAY = 47; 1450 public const int CTRY_PORTUGAL = 351; 1451 public const int CTRY_PRCHINA = 86; 1452 public const int CTRY_SOUTH_KOREA = 82; 1453 public const int CTRY_SPAIN = 34; 1454 public const int CTRY_SWEDEN = 46; 1455 public const int CTRY_SWITZERLAND = 41; 1456 public const int CTRY_TAIWAN = 886; 1457 public const int CTRY_UNITED_KINGDOM = 44; 1458 public const int CTRY_UNITED_STATES = 1; 1459 public const int CT_CTYPE1 = 0x1; 1460 public const int CT_CTYPE2 = 0x2; 1461 public const int CT_CTYPE3 = 0x4; 1462 public const int DATABITS_16 = 0x10; 1463 public const int DATABITS_16X = 0x20; 1464 public const int DATABITS_5 = 0x1; 1465 public const int DATABITS_6 = 0x2; 1466 public const int DATABITS_7 = 0x4; 1467 public const int DATABITS_8 = 0x8; 1468 public const int DATE_LONGDATE = 0x2; 1469 public const int DATE_SHORTDATE = 0x1; 1470 public const int DDD_EXACT_MATCH_ON_REMOVE = 0x4; 1471 public const int DDD_RAW_TARGET_PATH = 0x1; 1472 public const int DDD_REMOVE_DEFINITION = 0x2; 1473 public const int DEBUG_ONLY_THIS_PROCESS = 0x2; 1474 public const int DEBUG_PROCESS = 0x1; 1475 public const int DELETE = 0x10000; 1476 public const int DETACHED_PROCESS = 0x8; 1477 public const int DFCS_ADJUSTRECT = 0x2000; 1478 public const int DFCS_BUTTON3STATE = 0x8; 1479 public const int DFCS_BUTTONCHECK = 0x0; 1480 public const int DFCS_BUTTONPUSH = 0x10; 1481 public const int DFCS_BUTTONRADIO = 0x4; 1482 public const int DFCS_BUTTONRADIOIMAGE = 0x1; 1483 public const int DFCS_BUTTONRADIOMASK = 0x2; 1484 public const int DFCS_CAPTIONCLOSE = 0x0; 1485 public const int DFCS_CAPTIONHELP = 0x4; 1486 public const int DFCS_CAPTIONMAX = 0x2; 1487 public const int DFCS_CAPTIONMIN = 0x1; 1488 public const int DFCS_CAPTIONRESTORE = 0x3; 1489 public const int DFCS_CHECKED = 0x400; 1490 public const int DFCS_FLAT = 0x4000; 1491 public const int DFCS_INACTIVE = 0x100; 1492 public const int DFCS_MENUARROW = 0x0; 1493 public const int DFCS_MENUARROWRIGHT = 0x4; 1494 public const int DFCS_MENUBULLET = 0x2; 1495 public const int DFCS_MENUCHECK = 0x1; 1496 public const int DFCS_MONO = 0x8000; 1497 public const int DFCS_PUSHED = 0x200; 1498 public const int DFCS_SCROLLCOMBOBOX = 0x5; 1499 public const int DFCS_SCROLLDOWN = 0x1; 1500 public const int DFCS_SCROLLLEFT = 0x2; 1501 public const int DFCS_SCROLLRIGHT = 0x3; 1502 public const int DFCS_SCROLLSIZEGRIP = 0x8; 1503 public const int DFCS_SCROLLSIZEGRIPRIGHT = 0x10; 1504 public const int DFCS_SCROLLUP = 0x0; 1505 public const int DFC_BUTTON = 4; 1506 public const int DFC_CAPTION = 1; 1507 public const int DFC_MENU = 2; 1508 public const int DFC_SCROLL = 3; 1509 public const int DOMAIN_ALIAS_RID_ACCOUNT_OPS = 0x224; 1510 public const int DOMAIN_ALIAS_RID_ADMINS = 0x220; 1511 public const int DOMAIN_ALIAS_RID_BACKUP_OPS = 0x227; 1512 public const int DOMAIN_ALIAS_RID_GUESTS = 0x222; 1513 public const int DOMAIN_ALIAS_RID_POWER_USERS = 0x223; 1514 public const int DOMAIN_ALIAS_RID_PRINT_OPS = 0x226; 1515 public const int DOMAIN_ALIAS_RID_REPLICATOR = 0x228; 1516 public const int DOMAIN_ALIAS_RID_SYSTEM_OPS = 0x225; 1517 public const int DOMAIN_ALIAS_RID_USERS = 0x221; 1518 public const int DOMAIN_GROUP_RID_ADMINS = 0x200; 1519 public const int DOMAIN_GROUP_RID_GUESTS = 0x202; 1520 public const int DOMAIN_GROUP_RID_USERS = 0x201; 1521 public const int DOMAIN_USER_RID_ADMIN = 0x1F4; 1522 public const int DOMAIN_USER_RID_GUEST = 0x1F5; 1523 public const int DONT_RESOLVE_DLL_REFERENCES = 0x1; 1524 public const int DOUBLE_CLICK = 0x2; 1525 public const int DRIVE_CDROM = 5; 1526 public const int DRIVE_FIXED = 3; 1527 public const int DRIVE_RAMDISK = 6; 1528 public const int DRIVE_REMOTE = 4; 1529 public const int DRIVE_REMOVABLE = 2; 1530 public const int DTR_CONTROL_DISABLE = 0x0; 1531 public const int DTR_CONTROL_ENABLE = 0x1; 1532 public const int DTR_CONTROL_HANDSHAKE = 0x2; 1533 public const int DUPLICATE_CLOSE_SOURCE = 0x1; 1534 public const int DUPLICATE_SAME_ACCESS = 0x2; 1535 public const int ENABLE_ECHO_INPUT = 0x4; 1536 public const int ENABLE_LINE_INPUT = 0x2; 1537 public const int ENABLE_MOUSE_INPUT = 0x10; 1538 public const int ENABLE_PROCESSED_INPUT = 0x1; 1539 public const int ENABLE_PROCESSED_OUTPUT = 0x1; 1540 public const int ENABLE_WINDOW_INPUT = 0x8; 1541 public const int ENABLE_WRAP_AT_EOL_OUTPUT = 0x2; 1542 public const int ENHANCED_KEY = 0x100; 1543 public const int ENUM_ALL_CALENDARS = 0xFFFF; 1544 public const int ERROR_SEVERITY_ERROR = unchecked((int)0xC0000000); 1545 public const int ERROR_SEVERITY_INFORMATIONAL = 0x40000000; 1546 public const int ERROR_SEVERITY_SUCCESS = 0x0; 1547 public const int ERROR_SEVERITY_WARNING = unchecked((int)0x80000000); 1548 public const int EVENPARITY = 2; 1549 public const int EV_BREAK = 0x40; 1550 public const int EV_CTS = 0x8; 1551 public const int EV_DSR = 0x10; 1552 public const int EV_ERR = 0x80; 1553 public const int EV_EVENT1 = 0x800; 1554 public const int EV_EVENT2 = 0x1000; 1555 public const int EV_PERR = 0x200; 1556 public const int EV_RING = 0x100; 1557 public const int EV_RLSD = 0x20; 1558 public const int EV_RX80FULL = 0x400; 1559 public const int EV_RXCHAR = 0x1; 1560 public const int EV_RXFLAG = 0x2; 1561 public const int EV_TXEMPTY = 0x4; 1562 public const int EXCEPTION_CONTINUE_EXECUTION = -1; 1563 public const int EXCEPTION_CONTINUE_SEARCH = 0; 1564 public const int EXCEPTION_DEBUG_EVENT = 1; 1565 public const int EXCEPTION_EXECUTE_HANDLER = 1; 1566 public const int EXCEPTION_MAXIMUM_PARAMETERS = 15; 1567 public const int EXIT_PROCESS_DEBUG_EVENT = 5; 1568 public const int EXIT_THREAD_DEBUG_EVENT = 4; 1569 public const int FAILED_ACCESS_ACE_FLAG = 0x80; 1570 public const int FILE_ADD_FILE = (0x2); 1571 public const int FILE_ADD_SUBDIRECTORY = (0x4); 1572 public const int FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF); 1573 public const int FILE_APPEND_DATA = (0x4); 1574 public const int FILE_ATTRIBUTE_ARCHIVE = 0x20; 1575 public const int FILE_ATTRIBUTE_COMPRESSED = 0x800; 1576 public const int FILE_ATTRIBUTE_DIRECTORY = 0x10; 1577 public const int FILE_ATTRIBUTE_HIDDEN = 0x2; 1578 public const int FILE_ATTRIBUTE_NORMAL = 0x80; 1579 public const int FILE_ATTRIBUTE_READONLY = 0x1; 1580 public const int FILE_ATTRIBUTE_SYSTEM = 0x4; 1581 public const int FILE_ATTRIBUTE_TEMPORARY = 0x100; 1582 public const int FILE_BEGIN = 0; 1583 public const int FILE_CASE_PRESERVED_NAMES = 0x2; 1584 public const int FILE_CASE_SENSITIVE_SEARCH = 0x1; 1585 public const int FILE_CREATE_PIPE_INSTANCE = (0x4); 1586 public const int FILE_CURRENT = 1; 1587 public const int FILE_DELETE_CHILD = (0x40); 1588 public const int FILE_END = 2; 1589 public const int FILE_EXECUTE = (0x20); 1590 public const int FILE_FILE_COMPRESSION = 0x10; 1591 public const int FILE_FLAG_BACKUP_SEMANTICS = 0x2000000; 1592 public const int FILE_FLAG_DELETE_ON_CLOSE = 0x4000000; 1593 public const int FILE_FLAG_NO_BUFFERING = 0x20000000; 1594 public const int FILE_FLAG_OVERLAPPED = 0x40000000; 1595 public const int FILE_FLAG_POSIX_SEMANTICS = 0x1000000; 1596 public const int FILE_FLAG_RANDOM_ACCESS = 0x10000000; 1597 public const int FILE_FLAG_SEQUENTIAL_SCAN = 0x8000000; 1598 public const int FILE_FLAG_WRITE_THROUGH = unchecked((int)0x80000000); 1599 public const int FILE_GENERIC_EXECUTE = (STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE); 1600 public const int FILE_GENERIC_READ = (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE); 1601 public const int FILE_GENERIC_WRITE = (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE); 1602 public const int FILE_LIST_DIRECTORY = (0x1); 1603 public const int FILE_MAP_ALL_ACCESS = SECTION_ALL_ACCESS; 1604 public const int FILE_MAP_COPY = SECTION_QUERY; 1605 public const int FILE_MAP_READ = SECTION_MAP_READ; 1606 public const int FILE_MAP_WRITE = SECTION_MAP_WRITE; 1607 public const int FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x4; 1608 public const int FILE_NOTIFY_CHANGE_DIR_NAME = 0x2; 1609 public const int FILE_NOTIFY_CHANGE_FILE_NAME = 0x1; 1610 public const int FILE_NOTIFY_CHANGE_LAST_WRITE = 0x10; 1611 public const int FILE_NOTIFY_CHANGE_SECURITY = 0x100; 1612 public const int FILE_NOTIFY_CHANGE_SIZE = 0x8; 1613 public const int FILE_PERSISTENT_ACLS = 0x8; 1614 public const int FILE_READ_ATTRIBUTES = (0x80); 1615 public const int FILE_READ_DATA = (0x1); 1616 public const int FILE_READ_EA = (0x8); 1617 public const int FILE_READ_PROPERTIES = FILE_READ_EA; 1618 public const int FILE_SHARE_READ = 0x1; 1619 public const int FILE_SHARE_WRITE = 0x2; 1620 public const int FILE_TRAVERSE = (0x20); 1621 public const int FILE_TYPE_CHAR = 0x2; 1622 public const int FILE_TYPE_DISK = 0x1; 1623 public const int FILE_TYPE_PIPE = 0x3; 1624 public const int FILE_TYPE_REMOTE = 0x8000; 1625 public const int FILE_TYPE_UNKNOWN = 0x0; 1626 public const int FILE_UNICODE_ON_DISK = 0x4; 1627 public const int FILE_VOLUME_IS_COMPRESSED = 0x8000; 1628 public const int FILE_WRITE_ATTRIBUTES = (0x100); 1629 public const int FILE_WRITE_DATA = (0x2); 1630 public const int FILE_WRITE_EA = (0x10); 1631 public const int FILE_WRITE_PROPERTIES = FILE_WRITE_EA; 1632 public const int FOCUS_EVENT = 0x10; 1633 public const int FOREGROUND_BLUE = 0x1; 1634 public const int FOREGROUND_GREEN = 0x2; 1635 public const int FOREGROUND_INTENSITY = 0x8; 1636 public const int FOREGROUND_RED = 0x4; 1637 public const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x100; 1638 public const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x2000; 1639 public const int FORMAT_MESSAGE_FROM_HMODULE = 0x800; 1640 public const int FORMAT_MESSAGE_FROM_STRING = 0x400; 1641 public const int FORMAT_MESSAGE_FROM_SYSTEM = 0x1000; 1642 public const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x200; 1643 public const int FORMAT_MESSAGE_MAX_WIDTH_MASK = 0xFF; 1644 public const int FROM_LEFT_1ST_BUTTON_PRESSED = 0x1; 1645 public const int FROM_LEFT_2ND_BUTTON_PRESSED = 0x4; 1646 public const int FROM_LEFT_3RD_BUTTON_PRESSED = 0x8; 1647 public const int FROM_LEFT_4TH_BUTTON_PRESSED = 0x10; 1648 public const int FS_CASE_IS_PRESERVED = FILE_CASE_PRESERVED_NAMES; 1649 public const int FS_CASE_SENSITIVE = FILE_CASE_SENSITIVE_SEARCH; 1650 public const int FS_PERSISTENT_ACLS = FILE_PERSISTENT_ACLS; 1651 public const int FS_UNICODE_STORED_ON_DISK = FILE_UNICODE_ON_DISK; 1652 public const int GENERIC_ALL = 0x10000000; 1653 public const int GENERIC_EXECUTE = 0x20000000; 1654 public const int GENERIC_READ = unchecked((int)0x80000000); 1655 public const int GENERIC_WRITE = 0x40000000; 1656 public const int GET_TAPE_DRIVE_INFORMATION = 1; 1657 public const int GET_TAPE_MEDIA_INFORMATION = 0; 1658 public const int GHND = (GMEM_MOVEABLE | GMEM_ZEROINIT); 1659 public const int GMEM_DDESHARE = 0x2000; 1660 public const int GMEM_DISCARDABLE = 0x100; 1661 public const int GMEM_DISCARDED = 0x4000; 1662 public const int GMEM_FIXED = 0x0; 1663 public const int GMEM_INVALID_HANDLE = 0x8000; 1664 public const int GMEM_LOCKCOUNT = 0xFF; 1665 public const int GMEM_LOWER = GMEM_NOT_BANKED; 1666 public const int GMEM_MODIFY = 0x80; 1667 public const int GMEM_MOVEABLE = 0x2; 1668 public const int GMEM_NOCOMPACT = 0x10; 1669 public const int GMEM_NODISCARD = 0x20; 1670 public const int GMEM_NOTIFY = 0x4000; 1671 public const int GMEM_NOT_BANKED = 0x1000; 1672 public const int GMEM_SHARE = 0x2000; 1673 public const int GMEM_VALID_FLAGS = 0x7F72; 1674 public const int GMEM_ZEROINIT = 0x40; 1675 public const int GPTR = (GMEM_FIXED | GMEM_ZEROINIT); 1676 public const int HIGH_PRIORITY_CLASS = 0x80; 1677 public const int HKEY_CLASSES_ROOT = unchecked((int)0x80000000); 1678 public const int HKEY_CURRENT_CONFIG = unchecked((int)0x80000005); 1679 public const int HKEY_CURRENT_USER = unchecked((int)0x80000001); 1680 public const int HKEY_DYN_DATA = unchecked((int)0x80000006); 1681 public const int HKEY_LOCAL_MACHINE = unchecked((int)0x80000002); 1682 public const int HKEY_PERFORMANCE_DATA = unchecked((int)0x80000004); 1683 public const int HKEY_USERS = unchecked((int)0x80000003); 1684 public const int IDLE_PRIORITY_CLASS = 0x40; 1685 public const int IE_BADID = (-1); 1686 public const int IE_BAUDRATE = (-12); 1687 public const int IE_BYTESIZE = (-11); 1688 public const int IE_DEFAULT = (-5); 1689 public const int IE_HARDWARE = (-10); 1690 public const int IE_MEMORY = (-4); 1691 public const int IE_NOPEN = (-3); 1692 public const int IE_OPEN = (-2); 1693 public const int IGNORE = 0; 1694 public const int INFINITE = 0xFFFF; 1695 public const int INHERIT_ONLY_ACE = 0x8; 1696 public const int IO_COMPLETION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3); 1697 public const int IO_COMPLETION_MODIFY_STATE = 0x2; 1698 public const int KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | KEY_CREATE_LINK) & (~ SYNCHRONIZE)); 1699 public const int KEY_CREATE_LINK = 0x20; 1700 public const int KEY_CREATE_SUB_KEY = 0x4; 1701 public const int KEY_ENUMERATE_SUB_KEYS = 0x8; 1702 public const int KEY_EVENT = 0x1; 1703 public const int KEY_EXECUTE = ((KEY_READ) & (~ SYNCHRONIZE)); 1704 public const int KEY_NOTIFY = 0x10; 1705 public const int KEY_QUERY_VALUE = 0x1; 1706 public const int KEY_READ = ((STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY) & (~ SYNCHRONIZE)); 1707 public const int KEY_SET_VALUE = 0x2; 1708 public const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY) & (~ SYNCHRONIZE)); 1709 public const int LANG_BULGARIAN = 0x2; 1710 public const int LANG_CHINESE = 0x4; 1711 public const int LANG_CROATIAN = 0x1A; 1712 public const int LANG_CZECH = 0x5; 1713 public const int LANG_DANISH = 0x6; 1714 public const int LANG_DUTCH = 0x13; 1715 public const int LANG_ENGLISH = 0x9; 1716 public const int LANG_FINNISH = 0xB; 1717 public const int LANG_FRENCH = 0xC; 1718 public const int LANG_GERMAN = 0x7; 1719 public const int LANG_GREEK = 0x8; 1720 public const int LANG_HUNGARIAN = 0xE; 1721 public const int LANG_ICELANDIC = 0xF; 1722 public const int LANG_ITALIAN = 0x10; 1723 public const int LANG_JAPANESE = 0x11; 1724 public const int LANG_KOREAN = 0x12; 1725 public const int LANG_NEUTRAL = 0x0; 1726 public const int LANG_NORWEGIAN = 0x14; 1727 public const int LANG_POLISH = 0x15; 1728 public const int LANG_PORTUGUESE = 0x16; 1729 public const int LANG_ROMANIAN = 0x18; 1730 public const int LANG_RUSSIAN = 0x19; 1731 public const int LANG_SLOVAK = 0x1B; 1732 public const int LANG_SLOVENIAN = 0x24; 1733 public const int LANG_SPANISH = 0xA; 1734 public const int LANG_SWEDISH = 0x1D; 1735 public const int LANG_TURKISH = 0x1F; 1736 public const int LCMAP_BYTEREV = 0x800; 1737 public const int LCMAP_LOWERCASE = 0x100; 1738 public const int LCMAP_SORTKEY = 0x400; 1739 public const int LCMAP_UPPERCASE = 0x200; 1740 public const int LEFT_ALT_PRESSED = 0x2; 1741 public const int LEFT_CTRL_PRESSED = 0x8; 1742 public const int LHND = (LMEM_MOVEABLE + LMEM_ZEROINIT); 1743 public const int LMEM_DISCARDABLE = 0xF00; 1744 public const int LMEM_DISCARDED = 0x4000; 1745 public const int LMEM_FIXED = 0x0; 1746 public const int LMEM_INVALID_HANDLE = 0x8000; 1747 public const int LMEM_LOCKCOUNT = 0xFF; 1748 public const int LMEM_MODIFY = 0x80; 1749 public const int LMEM_MOVEABLE = 0x2; 1750 public const int LMEM_NOCOMPACT = 0x10; 1751 public const int LMEM_NODISCARD = 0x20; 1752 public const int LMEM_VALID_FLAGS = 0xF72; 1753 public const int LMEM_ZEROINIT = 0x40; 1754 public const int LNOTIFY_DISCARD = 2; 1755 public const int LNOTIFY_MOVE = 1; 1756 public const int LNOTIFY_OUTOFMEM = 0; 1757 public const int LOAD_DLL_DEBUG_EVENT = 6; 1758 public const int LOCALE_ICENTURY = 0x24; 1759 public const int LOCALE_ICOUNTRY = 0x5; 1760 public const int LOCALE_ICURRDIGITS = 0x19; 1761 public const int LOCALE_ICURRENCY = 0x1B; 1762 public const int LOCALE_IDATE = 0x21; 1763 public const int LOCALE_IDAYLZERO = 0x26; 1764 public const int LOCALE_IDEFAULTCODEPAGE = 0xB; 1765 public const int LOCALE_IDEFAULTCOUNTRY = 0xA; 1766 public const int LOCALE_IDEFAULTLANGUAGE = 0x9; 1767 public const int LOCALE_IDIGITS = 0x11; 1768 public const int LOCALE_IINTLCURRDIGITS = 0x1A; 1769 public const int LOCALE_ILANGUAGE = 0x1; 1770 public const int LOCALE_ILDATE = 0x22; 1771 public const int LOCALE_ILZERO = 0x12; 1772 public const int LOCALE_IMEASURE = 0xD; 1773 public const int LOCALE_IMONLZERO = 0x27; 1774 public const int LOCALE_INEGCURR = 0x1C; 1775 public const int LOCALE_INEGSEPBYSPACE = 0x57; 1776 public const int LOCALE_INEGSIGNPOSN = 0x53; 1777 public const int LOCALE_INEGSYMPRECEDES = 0x56; 1778 public const int LOCALE_IPOSSEPBYSPACE = 0x55; 1779 public const int LOCALE_IPOSSIGNPOSN = 0x52; 1780 public const int LOCALE_IPOSSYMPRECEDES = 0x54; 1781 public const int LOCALE_ITIME = 0x23; 1782 public const int LOCALE_ITLZERO = 0x25; 1783 public const int LOCALE_NOUSEROVERRIDE = unchecked((int) 0x80000000); 1784 public const int LOCALE_S1159 = 0x28; 1785 public const int LOCALE_S2359 = 0x29; 1786 public const int LOCALE_SABBREVCTRYNAME = 0x7; 1787 public const int LOCALE_SABBREVDAYNAME1 = 0x31; 1788 public const int LOCALE_SABBREVDAYNAME2 = 0x32; 1789 public const int LOCALE_SABBREVDAYNAME3 = 0x33; 1790 public const int LOCALE_SABBREVDAYNAME4 = 0x34; 1791 public const int LOCALE_SABBREVDAYNAME5 = 0x35; 1792 public const int LOCALE_SABBREVDAYNAME6 = 0x36; 1793 public const int LOCALE_SABBREVDAYNAME7 = 0x37; 1794 public const int LOCALE_SABBREVLANGNAME = 0x3; 1795 public const int LOCALE_SABBREVMONTHNAME1 = 0x44; 1796 public const int LOCALE_SABBREVMONTHNAME10 = 0x4D; 1797 public const int LOCALE_SABBREVMONTHNAME11 = 0x4E; 1798 public const int LOCALE_SABBREVMONTHNAME12 = 0x4F; 1799 public const int LOCALE_SABBREVMONTHNAME13 = 0x100F; 1800 public const int LOCALE_SABBREVMONTHNAME2 = 0x45; 1801 public const int LOCALE_SABBREVMONTHNAME3 = 0x46; 1802 public const int LOCALE_SABBREVMONTHNAME4 = 0x47; 1803 public const int LOCALE_SABBREVMONTHNAME5 = 0x48; 1804 public const int LOCALE_SABBREVMONTHNAME6 = 0x49; 1805 public const int LOCALE_SABBREVMONTHNAME7 = 0x4A; 1806 public const int LOCALE_SABBREVMONTHNAME8 = 0x4B; 1807 public const int LOCALE_SABBREVMONTHNAME9 = 0x4C; 1808 public const int LOCALE_SCOUNTRY = 0x6; 1809 public const int LOCALE_SCURRENCY = 0x14; 1810 public const int LOCALE_SDATE = 0x1D; 1811 public const int LOCALE_SDAYNAME1 = 0x2A; 1812 public const int LOCALE_SDAYNAME2 = 0x2B; 1813 public const int LOCALE_SDAYNAME3 = 0x2C; 1814 public const int LOCALE_SDAYNAME4 = 0x2D; 1815 public const int LOCALE_SDAYNAME5 = 0x2E; 1816 public const int LOCALE_SDAYNAME6 = 0x2F; 1817 public const int LOCALE_SDAYNAME7 = 0x30; 1818 public const int LOCALE_SDECIMAL = 0xE; 1819 public const int LOCALE_SENGCOUNTRY = 0x1002; 1820 public const int LOCALE_SENGLANGUAGE = 0x1001; 1821 public const int LOCALE_SGROUPING = 0x10; 1822 public const int LOCALE_SINTLSYMBOL = 0x15; 1823 public const int LOCALE_SLANGUAGE = 0x2; 1824 public const int LOCALE_SLIST = 0xC; 1825 public const int LOCALE_SLONGDATE = 0x20; 1826 public const int LOCALE_SMONDECIMALSEP = 0x16; 1827 public const int LOCALE_SMONGROUPING = 0x18; 1828 public const int LOCALE_SMONTHNAME1 = 0x38; 1829 public const int LOCALE_SMONTHNAME10 = 0x41; 1830 public const int LOCALE_SMONTHNAME11 = 0x42; 1831 public const int LOCALE_SMONTHNAME12 = 0x43; 1832 public const int LOCALE_SMONTHNAME2 = 0x39; 1833 public const int LOCALE_SMONTHNAME3 = 0x3A; 1834 public const int LOCALE_SMONTHNAME4 = 0x3B; 1835 public const int LOCALE_SMONTHNAME5 = 0x3C; 1836 public const int LOCALE_SMONTHNAME6 = 0x3D; 1837 public const int LOCALE_SMONTHNAME7 = 0x3E; 1838 public const int LOCALE_SMONTHNAME8 = 0x3F; 1839 public const int LOCALE_SMONTHNAME9 = 0x40; 1840 public const int LOCALE_SMONTHOUSANDSEP = 0x17; 1841 public const int LOCALE_SNATIVECTRYNAME = 0x8; 1842 public const int LOCALE_SNATIVEDIGITS = 0x13; 1843 public const int LOCALE_SNATIVELANGNAME = 0x4; 1844 public const int LOCALE_SNEGATIVESIGN = 0x51; 1845 public const int LOCALE_SPOSITIVESIGN = 0x50; 1846 public const int LOCALE_SSHORTDATE = 0x1F; 1847 public const int LOCALE_STHOUSAND = 0xF; 1848 public const int LOCALE_STIME = 0x1E; 1849 public const int LOCALE_STIMEFORMAT = 0x1003; 1850 public const int LOCKFILE_EXCLUSIVE_LOCK = 0x2; 1851 public const int LOCKFILE_FAIL_IMMEDIATELY = 0x1; 1852 public const int LOGON32_LOGON_BATCH = 4; 1853 public const int LOGON32_LOGON_INTERACTIVE = 2; 1854 public const int LOGON32_LOGON_SERVICE = 5; 1855 public const int LOGON32_PROVIDER_DEFAULT = 0; 1856 public const int LOGON32_PROVIDER_WINNT35 = 1; 1857 public const int LPTR = (LMEM_FIXED + LMEM_ZEROINIT); 1858 public const int LPTx = 0x80; 1859 public const int MAILSLOT_NO_MESSAGE = (-1); 1860 public const int MAILSLOT_WAIT_FOREVER = (-1); 1861 public const int MAP_COMPOSITE = 0x40; 1862 public const int MAP_FOLDCZONE = 0x10; 1863 public const int MAP_FOLDDIGITS = 0x80; 1864 public const int MAP_PRECOMPOSED = 0x20; 1865 public const int MARKPARITY = 3; 1866 public const int MAXByte = 0xFF; 1867 public const int MAXCHAR = 0x7F; 1868 public const int MAXDWORD = unchecked((int)0xFFFFFFFF); 1869 public const int MAXIMUM_ALLOWED = 0x2000000; 1870 public const int MAXLONG = 0x7FFFFFFF; 1871 public const int MAXSHORT = 0x7FFF; 1872 public const int MAXWORD = 0xFFFF; 1873 public const int MAX_DEFAULTCHAR = 2; 1874 public const int MAX_LEADBYTES = 12; 1875 public const int MAX_PATH = 260; 1876 public const int MB_COMPOSITE = 0x2; 1877 public const int MB_PRECOMPOSED = 0x1; 1878 public const int MB_USEGLYPHCHARS = 0x4; 1879 public const int MENU_EVENT = 0x8; 1880 public const int MINCHAR = 0x80; 1881 public const int MINLONG = unchecked((int)0x80000000); 1882 public const int MINSHORT = 0x8000; 1883 public const int MOUSE_MOVED = 0x1; 1884 public const int MOVEFILE_COPY_ALLOWED = 0x2; 1885 public const int MOVEFILE_DELAY_UNTIL_REBOOT = 0x4; 1886 public const int MOVEFILE_REPLACE_EXISTING = 0x1; 1887 public const int MS_CTS_ON = 0x10; 1888 public const int MS_DSR_ON = 0x20; 1889 public const int MS_RING_ON = 0x40; 1890 public const int MS_RLSD_ON = 0x80; 1891 public const int NMPWAIT_NOWAIT = 0x1; 1892 public const int NMPWAIT_USE_DEFAULT_WAIT = 0x0; 1893 public const int NMPWAIT_WAIT_FOREVER = 0xFFFF; 1894 public const int NONZEROLHND = (LMEM_MOVEABLE); 1895 public const int NONZEROLPTR = (LMEM_FIXED); 1896 public const int NOPARITY = 0; 1897 public const int NORMAL_PRIORITY_CLASS = 0x20; 1898 public const int NORM_IGNORECASE = 0x1; 1899 public const int NORM_IGNORENONSPACE = 0x2; 1900 public const int NORM_IGNORESYMBOLS = 0x4; 1901 public const int NO_PROPAGATE_INHERIT_ACE = 0x4; 1902 public const int NUMLOCK_ON = 0x20; 1903 public const int OBJECT_INHERIT_ACE = 0x1; 1904 public const int ODDPARITY = 1; 1905 public const int OFS_MAXPATHNAME = 128; 1906 public const int OF_CANCEL = 0x800; 1907 public const int OF_CREATE = 0x1000; 1908 public const int OF_DELETE = 0x200; 1909 public const int OF_EXIST = 0x4000; 1910 public const int OF_PARSE = 0x100; 1911 public const int OF_PROMPT = 0x2000; 1912 public const int OF_READ = 0x0; 1913 public const int OF_READWRITE = 0x2; 1914 public const int OF_REOPEN = 0x8000; 1915 public const int OF_SHARE_COMPAT = 0x0; 1916 public const int OF_SHARE_DENY_NONE = 0x40; 1917 public const int OF_SHARE_DENY_READ = 0x30; 1918 public const int OF_SHARE_DENY_WRITE = 0x20; 1919 public const int OF_SHARE_EXCLUSIVE = 0x10; 1920 public const int OF_VERIFY = 0x400; 1921 public const int OF_WRITE = 0x1; 1922 public const int ONE5STOPBITS = 1; 1923 public const int ONESTOPBIT = 0; 1924 public const int OPEN_ALWAYS = 4; 1925 public const int OPEN_EXISTING = 3; 1926 public const int OUTPUT_DEBUG_STRING_EVENT = 8; 1927 public const int PARITY_EVEN = 0x400; 1928 public const int PARITY_MARK = 0x800; 1929 public const int PARITY_NONE = 0x100; 1930 public const int PARITY_ODD = 0x200; 1931 public const int PARITY_SPACE = 0x1000; 1932 public const int PCF_16BITMODE = 0x200; 1933 public const int PCF_DTRDSR = 0x1; 1934 public const int PCF_INTTIMEOUTS = 0x80; 1935 public const int PCF_PARITY_CHECK = 0x8; 1936 public const int PCF_RLSD = 0x4; 1937 public const int PCF_RTSCTS = 0x2; 1938 public const int PCF_SETXCHAR = 0x20; 1939 public const int PCF_SPECIALCHARS = 0x100; 1940 public const int PCF_TOTALTIMEOUTS = 0x40; 1941 public const int PCF_XONXOFF = 0x10; 1942 public const int PERF_100NSEC_MULTI_TIMER = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER | PERF_DISPLAY_PERCENT); 1943 public const int PERF_100NSEC_MULTI_TIMER_INV = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT); 1944 public const int PERF_100NSEC_TIMER = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT); 1945 public const int PERF_100NSEC_TIMER_INV = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT); 1946 public const int PERF_AVERAGE_BASE = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW | 0x2); 1947 public const int PERF_AVERAGE_BULK = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_NOSHOW); 1948 public const int PERF_AVERAGE_TIMER = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_SECONDS); 1949 public const int PERF_COUNTER_BASE = 0x30000; 1950 public const int PERF_COUNTER_BULK_COUNT = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC); 1951 public const int PERF_COUNTER_COUNTER = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC); 1952 public const int PERF_COUNTER_ELAPSED = 0x40000; 1953 public const int PERF_COUNTER_FRACTION = 0x20000; 1954 public const int PERF_COUNTER_HISTOGRAM = 0x60000; 1955 public const int PERF_COUNTER_HISTOGRAM_TYPE = unchecked((int)0x80000000); 1956 public const int PERF_COUNTER_MULTI_BASE = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_MULTI_COUNTER | PERF_DISPLAY_NOSHOW); 1957 public const int PERF_COUNTER_MULTI_TIMER = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_DELTA_COUNTER | PERF_TIMER_TICK | PERF_MULTI_COUNTER | PERF_DISPLAY_PERCENT); 1958 public const int PERF_COUNTER_MULTI_TIMER_INV = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_DELTA_COUNTER | PERF_MULTI_COUNTER | PERF_TIMER_TICK | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT); 1959 public const int PERF_COUNTER_NODATA = (PERF_SIZE_ZERO | PERF_DISPLAY_NOSHOW); 1960 public const int PERF_COUNTER_QUEUELEN = 0x50000; 1961 public const int PERF_COUNTER_QUEUELEN_TYPE = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX); 1962 public const int PERF_COUNTER_RATE = 0x10000; 1963 public const int PERF_COUNTER_RAWCOUNT = (PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL | PERF_DISPLAY_NO_SUFFIX); 1964 public const int PERF_COUNTER_TEXT = (PERF_SIZE_VARIABLE_LEN | PERF_TYPE_TEXT | PERF_TEXT_UNICODE | PERF_DISPLAY_NO_SUFFIX); 1965 public const int PERF_COUNTER_TIMER = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT); 1966 public const int PERF_COUNTER_TIMER_INV = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT); 1967 public const int PERF_COUNTER_VALUE = 0x0; 1968 public const int PERF_DATA_REVISION = 1; 1969 public const int PERF_DATA_VERSION = 1; 1970 public const int PERF_DELTA_BASE = 0x800000; 1971 public const int PERF_DELTA_COUNTER = 0x400000; 1972 public const int PERF_DETAIL_ADVANCED = 200; 1973 public const int PERF_DETAIL_EXPERT = 300; 1974 public const int PERF_DETAIL_NOVICE = 100; 1975 public const int PERF_DETAIL_WIZARD = 400; 1976 public const int PERF_DISPLAY_NOSHOW = 0x40000000; 1977 public const int PERF_DISPLAY_NO_SUFFIX = 0x0; 1978 public const int PERF_DISPLAY_PERCENT = 0x20000000; 1979 public const int PERF_DISPLAY_PER_SEC = 0x10000000; 1980 public const int PERF_DISPLAY_SECONDS = 0x30000000; 1981 public const int PERF_ELAPSED_TIME = (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED | PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS); 1982 public const int PERF_INVERSE_COUNTER = 0x1000000; 1983 public const int PERF_MULTI_COUNTER = 0x2000000; 1984 public const int PERF_NO_INSTANCES = -1; 1985 public const int PERF_NO_UNIQUE_ID = -1; 1986 public const int PERF_NUMBER_DECIMAL = 0x10000; 1987 public const int PERF_NUMBER_DEC_1000 = 0x20000; 1988 public const int PERF_NUMBER_HEX = 0x0; 1989 public const int PERF_OBJECT_TIMER = 0x200000; 1990 public const int PERF_RAW_BASE = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW | 0x3); 1991 public const int PERF_RAW_FRACTION = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_PERCENT); 1992 public const int PERF_SAMPLE_BASE = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW | 0x1); 1993 public const int PERF_SAMPLE_COUNTER = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX); 1994 public const int PERF_SAMPLE_FRACTION = (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DELTA_COUNTER | PERF_DELTA_BASE | PERF_DISPLAY_PERCENT); 1995 public const int PERF_SIZE_DWORD = 0x0; 1996 public const int PERF_SIZE_LARGE = 0x100; 1997 public const int PERF_SIZE_VARIABLE_LEN = 0x300; 1998 public const int PERF_SIZE_ZERO = 0x200; 1999 public const int PERF_TEXT_ASCII = 0x10000; 2000 public const int PERF_TEXT_UNICODE = 0x0; 2001 public const int PERF_TIMER_100NS = 0x100000; 2002 public const int PERF_TIMER_TICK = 0x0; 2003 public const int PERF_TYPE_COUNTER = 0x400; 2004 public const int PERF_TYPE_NUMBER = 0x0; 2005 public const int PERF_TYPE_TEXT = 0x800; 2006 public const int PERF_TYPE_ZERO = 0xC00; 2007 public const int PIPE_ACCESS_DUPLEX = 0x3; 2008 public const int PIPE_ACCESS_INBOUND = 0x1; 2009 public const int PIPE_ACCESS_OUTBOUND = 0x2; 2010 public const int PIPE_CLIENT_END = 0x0; 2011 public const int PIPE_NOWAIT = 0x1; 2012 public const int PIPE_READMODE_BYTE = 0x0; 2013 public const int PIPE_READMODE_MESSAGE = 0x2; 2014 public const int PIPE_SERVER_END = 0x1; 2015 public const int PIPE_TYPE_BYTE = 0x0; 2016 public const int PIPE_TYPE_MESSAGE = 0x4; 2017 public const int PIPE_UNLIMITED_INSTANCES = 255; 2018 public const int PIPE_WAIT = 0x0; 2019 public const int PRIVILEGE_SET_ALL_NECESSARY = (1); 2020 public const int PROCESSOR_ALPHA_21064 = 21064; 2021 public const int PROCESSOR_ARCHITECTURE_ALPHA = 2; 2022 public const int PROCESSOR_ARCHITECTURE_INTEL = 0; 2023 public const int PROCESSOR_ARCHITECTURE_MIPS = 1; 2024 public const int PROCESSOR_ARCHITECTURE_PPC = 3; 2025 public const int PROCESSOR_ARCHITECTURE_UNKNOWN = 0xFFFF; 2026 public const int PROCESSOR_INTEL_386 = 386; 2027 public const int PROCESSOR_INTEL_486 = 486; 2028 public const int PROCESSOR_INTEL_PENTIUM = 586; 2029 public const int PROCESSOR_MIPS_R4000 = 4000; 2030 public const int PROCESS_HEAP_ENTRY_BUSY = 0x4; 2031 public const int PROCESS_HEAP_ENTRY_DDESHARE = 0x20; 2032 public const int PROCESS_HEAP_ENTRY_MOVEABLE = 0x10; 2033 public const int PROCESS_HEAP_REGION = 0x1; 2034 public const int PROCESS_HEAP_UNCOMMITTED_RANGE = 0x2; 2035 public const int PROFILE_KERNEL = 0x20000000; 2036 public const int PROFILE_SERVER = 0x40000000; 2037 public const int PROFILE_USER = 0x10000000; 2038 public const int PST_FAX = 0x21; 2039 public const int PST_LAT = 0x101; 2040 public const int PST_NETWORK_BRIDGE = 0x100; 2041 public const int PST_PARALLELPORT = 0x2; 2042 public const int PST_RS232 = 0x1; 2043 public const int PST_RS422 = 0x3; 2044 public const int PST_RS423 = 0x4; 2045 public const int PST_RS449 = 0x5; 2046 public const int PST_SCANNER = 0x22; 2047 public const int PST_TCPIP_TELNET = 0x102; 2048 public const int PST_UNSPECIFIED = 0x0; 2049 public const int PST_X25 = 0x103; 2050 public const int PURGE_RXABORT = 0x2; 2051 public const int PURGE_RXCLEAR = 0x8; 2052 public const int PURGE_TXABORT = 0x1; 2053 public const int PURGE_TXCLEAR = 0x4; 2054 public const int READ_CONTROL = 0x20000; 2055 public const int REALTIME_PRIORITY_CLASS = 0x100; 2056 public const int REG_BINARY = 3; 2057 public const int REG_CREATED_NEW_KEY = 0x1; 2058 public const int REG_DWORD = 4; 2059 public const int REG_DWORD_BIG_ENDIAN = 5; 2060 public const int REG_DWORD_LITTLE_ENDIAN = 4; 2061 public const int REG_EXPAND_SZ = 2; 2062 public const int REG_FULL_RESOURCE_DESCRIPTOR = 9; 2063 public const int REG_LEGAL_CHANGE_FILTER = (REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_ATTRIBUTES | REG_NOTIFY_CHANGE_LAST_SET | REG_NOTIFY_CHANGE_SECURITY); 2064 public const int REG_LEGAL_OPTION = (REG_OPTION_RESERVED | REG_OPTION_NON_VOLATILE | REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK | REG_OPTION_BACKUP_RESTORE); 2065 public const int REG_LINK = 6; 2066 public const int REG_MULTI_SZ = 7; 2067 public const int REG_NONE = 0; 2068 public const int REG_NOTIFY_CHANGE_ATTRIBUTES = 0x2; 2069 public const int REG_NOTIFY_CHANGE_LAST_SET = 0x4; 2070 public const int REG_NOTIFY_CHANGE_NAME = 0x1; 2071 public const int REG_NOTIFY_CHANGE_SECURITY = 0x8; 2072 public const int REG_OPENED_EXISTING_KEY = 0x2; 2073 public const int REG_OPTION_BACKUP_RESTORE = 4; 2074 public const int REG_OPTION_CREATE_LINK = 2; 2075 public const int REG_OPTION_NON_VOLATILE = 0; 2076 public const int REG_OPTION_RESERVED = 0; 2077 public const int REG_OPTION_VOLATILE = 1; 2078 public const int REG_REFRESH_HIVE = 0x2; 2079 public const int REG_RESOURCE_LIST = 8; 2080 public const int REG_RESOURCE_REQUIREMENTS_LIST = 10; 2081 public const int REG_SZ = 1; 2082 public const int REG_WHOLE_HIVE_VOLATILE = 0x1; 2083 public const int RESETDEV = 7; 2084 public const int RIGHTMOST_BUTTON_PRESSED = 0x2; 2085 public const int RIGHT_ALT_PRESSED = 0x1; 2086 public const int RIGHT_CTRL_PRESSED = 0x4; 2087 public const int RIP_EVENT = 9; 2088 public const int RTS_CONTROL_DISABLE = 0x0; 2089 public const int RTS_CONTROL_ENABLE = 0x1; 2090 public const int RTS_CONTROL_HANDSHAKE = 0x2; 2091 public const int RTS_CONTROL_TOGGLE = 0x3; 2092 public const int RT_ACCELERATOR = 9; 2093 public const int RT_BITMAP = 2; 2094 public const int RT_CURSOR = 1; 2095 public const int RT_DIALOG = 5; 2096 public const int RT_FONT = 8; 2097 public const int RT_FONTDIR = 7; 2098 public const int RT_ICON = 3; 2099 public const int RT_MENU = 4; 2100 public const int RT_RCDATA = 10; 2101 public const int RT_STRING = 6; 2102 public const int SCROLLLOCK_ON = 0x40; 2103 public const int SCS_32BIT_BINARY = 0; 2104 public const int SCS_DOS_BINARY = 1; 2105 public const int SCS_OS216_BINARY = 5; 2106 public const int SCS_PIF_BINARY = 3; 2107 public const int SCS_POSIX_BINARY = 4; 2108 public const int SCS_WOW_BINARY = 2; 2109 public const int SC_MANAGER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE | SC_MANAGER_ENUMERATE_SERVICE | SC_MANAGER_LOCK | SC_MANAGER_QUERY_LOCK_STATUS | SC_MANAGER_MODIFY_BOOT_CONFIG); 2110 public const int SC_MANAGER_CONNECT = 0x1; 2111 public const int SC_MANAGER_CREATE_SERVICE = 0x2; 2112 public const int SC_MANAGER_ENUMERATE_SERVICE = 0x4; 2113 public const int SC_MANAGER_LOCK = 0x8; 2114 public const int SC_MANAGER_MODIFY_BOOT_CONFIG = 0x20; 2115 public const int SC_MANAGER_QUERY_LOCK_STATUS = 0x10; 2116 public const int SECTION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE; 2117 public const int SECTION_EXTEND_SIZE = 0x10; 2118 public const int SECTION_MAP_EXECUTE = 0x8; 2119 public const int SECTION_MAP_READ = 0x4; 2120 public const int SECTION_MAP_WRITE = 0x2; 2121 public const int SECTION_QUERY = 0x1; 2122 public const int SECURITY_ANONYMOUS_LOGON_RID = 0x7; 2123 public const int SECURITY_BATCH_RID = 0x3; 2124 public const int SECURITY_BUILTIN_DOMAIN_RID = 0x20; 2125 public const int SECURITY_CONTEXT_TRACKING = 0x40000; 2126 public const int SECURITY_CREATOR_GROUP_RID = 0x1; 2127 public const int SECURITY_CREATOR_OWNER_RID = 0x0; 2128 public const int SECURITY_DESCRIPTOR_MIN_LENGTH = (20); 2129 public const int SECURITY_DESCRIPTOR_REVISION = (1); 2130 public const int SECURITY_DESCRIPTOR_REVISION1 = (1); 2131 public const int SECURITY_DIALUP_RID = 0x1; 2132 public const int SECURITY_EFFECTIVE_ONLY = 0x80000; 2133 public const int SECURITY_INTERACTIVE_RID = 0x4; 2134 public const int SECURITY_LOCAL_RID = 0x0; 2135 public const int SECURITY_LOCAL_SYSTEM_RID = 0x12; 2136 public const int SECURITY_LOGON_IDS_RID = 0x5; 2137 public const int SECURITY_NETWORK_RID = 0x2; 2138 public const int SECURITY_NT_NON_UNIQUE = 0x15; 2139 public const int SECURITY_NULL_RID = 0x0; 2140 public const int SECURITY_SERVICE_RID = 0x6; 2141 public const int SECURITY_SQOS_PRESENT = 0x100000; 2142 public const int SECURITY_VALID_SQOS_FLAGS = 0x1F0000; 2143 public const int SECURITY_WORLD_RID = 0x0; 2144 public const int SEM_FAILCRITICALERRORS = 0x1; 2145 public const int SEM_NOGPFAULTERRORBOX = 0x2; 2146 public const int SEM_NOOPENFILEERRORBOX = 0x8000; 2147 public const int SERVICE_ACCEPT_PAUSE_CONTINUE = 0x2; 2148 public const int SERVICE_ACCEPT_SHUTDOWN = 0x4; 2149 public const int SERVICE_ACCEPT_STOP = 0x1; 2150 public const int SERVICE_ACTIVE = 0x1; 2151 public const int SERVICE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS | SERVICE_START | SERVICE_STOP | SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_USER_DEFINED_CONTROL); 2152 public const int SERVICE_CHANGE_CONFIG = 0x2; 2153 public const int SERVICE_CONTINUE_PENDING = 0x5; 2154 public const int SERVICE_CONTROL_CONTINUE = 0x3; 2155 public const int SERVICE_CONTROL_INTERROGATE = 0x4; 2156 public const int SERVICE_CONTROL_PAUSE = 0x2; 2157 public const int SERVICE_CONTROL_SHUTDOWN = 0x5; 2158 public const int SERVICE_CONTROL_STOP = 0x1; 2159 public const int SERVICE_ENUMERATE_DEPENDENTS = 0x8; 2160 public const int SERVICE_INACTIVE = 0x2; 2161 public const int SERVICE_INTERROGATE = 0x80; 2162 public const int SERVICE_NO_CHANGE = 0xFFFF; 2163 public const int SERVICE_PAUSED = 0x7; 2164 public const int SERVICE_PAUSE_CONTINUE = 0x40; 2165 public const int SERVICE_PAUSE_PENDING = 0x6; 2166 public const int SERVICE_QUERY_CONFIG = 0x1; 2167 public const int SERVICE_QUERY_STATUS = 0x4; 2168 public const int SERVICE_RUNNING = 0x4; 2169 public const int SERVICE_START = 0x10; 2170 public const int SERVICE_START_PENDING = 0x2; 2171 public const int SERVICE_STATE_ALL = (SERVICE_ACTIVE | SERVICE_INACTIVE); 2172 public const int SERVICE_STOP = 0x20; 2173 public const int SERVICE_STOPPED = 0x1; 2174 public const int SERVICE_STOP_PENDING = 0x3; 2175 public const int SERVICE_USER_DEFINED_CONTROL = 0x100; 2176 public const int SETBREAK = 8; 2177 public const int SETDTR = 5; 2178 public const int SETRTS = 3; 2179 public const int SETXOFF = 1; 2180 public const int SETXON = 2; 2181 public const int SET_TAPE_DRIVE_INFORMATION = 1; 2182 public const int SET_TAPE_MEDIA_INFORMATION = 0; 2183 public const int SE_DACL_DEFAULTED = 0x8; 2184 public const int SE_DACL_PRESENT = 0x4; 2185 public const int SE_GROUP_DEFAULTED = 0x2; 2186 public const int SE_GROUP_ENABLED = 0x4; 2187 public const int SE_GROUP_ENABLED_BY_DEFAULT = 0x2; 2188 public const int SE_GROUP_LOGON_ID = unchecked((int)0xC0000000); 2189 public const int SE_GROUP_MANDATORY = 0x1; 2190 public const int SE_GROUP_OWNER = 0x8; 2191 public const int SE_OWNER_DEFAULTED = 0x1; 2192 public const int SE_PRIVILEGE_ENABLED = 0x2; 2193 public const int SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x1; 2194 public const int SE_PRIVILEGE_USED_FOR_ACCESS = unchecked((int)0x80000000); 2195 public const int SE_SACL_DEFAULTED = 0x20; 2196 public const int SE_SACL_PRESENT = 0x10; 2197 public const int SE_SELF_RELATIVE = 0x8000; 2198 public const int SHIFT_PRESSED = 0x10; 2199 public const int SHUTDOWN_NORETRY = 0x1; 2200 public const int SID_MAX_SUB_AUTHORITIES = (15); 2201 public const int SID_RECOMMENDED_SUB_AUTHORITIES = (1); 2202 public const int SID_REVISION = (1); 2203 public const int SLE_ERROR = 0x1; 2204 public const int SLE_MINORERROR = 0x2; 2205 public const int SLE_WARNING = 0x3; 2206 public const int SORT_CHINESE_BIG5 = 0x0; 2207 public const int SORT_CHINESE_UNICODE = 0x1; 2208 public const int SORT_DEFAULT = 0x0; 2209 public const int SORT_JAPANESE_UNICODE = 0x1; 2210 public const int SORT_JAPANESE_XJIS = 0x0; 2211 public const int SORT_KOREAN_KSC = 0x0; 2212 public const int SORT_KOREAN_UNICODE = 0x1; 2213 public const int SORT_STRINGSORT = 0x1000; 2214 public const int SPACEPARITY = 4; 2215 public const int SPECIFIC_RIGHTS_ALL = 0xFFFF; 2216 public const int SP_BAUD = 0x2; 2217 public const int SP_DATABITS = 0x4; 2218 public const int SP_HANDSHAKING = 0x10; 2219 public const int SP_PARITY = 0x1; 2220 public const int SP_PARITY_CHECK = 0x20; 2221 public const int SP_RLSD = 0x40; 2222 public const int SP_SERIALCOMM = 0x1; 2223 public const int SP_STOPBITS = 0x8; 2224 public const int STANDARD_RIGHTS_ALL = 0x1F0000; 2225 public const int STANDARD_RIGHTS_EXECUTE = (READ_CONTROL); 2226 public const int STANDARD_RIGHTS_READ = (READ_CONTROL); 2227 public const int STANDARD_RIGHTS_REQUIRED = 0xF0000; 2228 public const int STANDARD_RIGHTS_WRITE = (READ_CONTROL); 2229 public const int STARTF_FORCEOFFFEEDBACK = 0x80; 2230 public const int STARTF_FORCEONFEEDBACK = 0x40; 2231 public const int STARTF_RUNFULLSCREEN = 0x20; 2232 public const int STARTF_USECOUNTCHARS = 0x8; 2233 public const int STARTF_USEFILLATTRIBUTE = 0x10; 2234 public const int STARTF_USEPOSITION = 0x4; 2235 public const int STARTF_USESHOWWINDOW = 0x1; 2236 public const int STARTF_USESIZE = 0x2; 2237 public const int STARTF_USESTDHANDLES = 0x100; 2238 public const int STD_ERROR_HANDLE = -12; 2239 public const int STD_INPUT_HANDLE = -10; 2240 public const int STD_OUTPUT_HANDLE = -11; 2241 public const int STOPBITS_10 = 0x1; 2242 public const int STOPBITS_15 = 0x2; 2243 public const int STOPBITS_20 = 0x4; 2244 public const int STREAM_CONTAINS_SECURITY = 0x2; 2245 public const int STREAM_MODIFIED_WHEN_READ = 0x1; 2246 public const int SUBLANG_CHINESE_HONGKONG = 0x3; 2247 public const int SUBLANG_CHINESE_SIMPLIFIED = 0x2; 2248 public const int SUBLANG_CHINESE_SINGAPORE = 0x4; 2249 public const int SUBLANG_CHINESE_TRADITIONAL = 0x1; 2250 public const int SUBLANG_DEFAULT = 0x1; 2251 public const int SUBLANG_DUTCH = 0x1; 2252 public const int SUBLANG_DUTCH_BELGIAN = 0x2; 2253 public const int SUBLANG_ENGLISH_AUS = 0x3; 2254 public const int SUBLANG_ENGLISH_CAN = 0x4; 2255 public const int SUBLANG_ENGLISH_EIRE = 0x6; 2256 public const int SUBLANG_ENGLISH_NZ = 0x5; 2257 public const int SUBLANG_ENGLISH_UK = 0x2; 2258 public const int SUBLANG_ENGLISH_US = 0x1; 2259 public const int SUBLANG_FRENCH = 0x1; 2260 public const int SUBLANG_FRENCH_BELGIAN = 0x2; 2261 public const int SUBLANG_FRENCH_CANADIAN = 0x3; 2262 public const int SUBLANG_FRENCH_SWISS = 0x4; 2263 public const int SUBLANG_GERMAN = 0x1; 2264 public const int SUBLANG_GERMAN_AUSTRIAN = 0x3; 2265 public const int SUBLANG_GERMAN_SWISS = 0x2; 2266 public const int SUBLANG_ITALIAN = 0x1; 2267 public const int SUBLANG_ITALIAN_SWISS = 0x2; 2268 public const int SUBLANG_NEUTRAL = 0x0; 2269 public const int SUBLANG_NORWEGIAN_BOKMAL = 0x1; 2270 public const int SUBLANG_NORWEGIAN_NYNORSK = 0x2; 2271 public const int SUBLANG_PORTUGUESE = 0x2; 2272 public const int SUBLANG_PORTUGUESE_BRAZILIAN = 0x1; 2273 public const int SUBLANG_SPANISH = 0x1; 2274 public const int SUBLANG_SPANISH_MEXICAN = 0x2; 2275 public const int SUBLANG_SPANISH_MODERN = 0x3; 2276 public const int SUBLANG_SYS_DEFAULT = 0x2; 2277 public const int SUCCESSFUL_ACCESS_ACE_FLAG = 0x40; 2278 public const int SYNCHRONIZE = 0x100000; 2279 public const int SYSTEM_ALARM_ACE_TYPE = 0x3; 2280 public const int SYSTEM_AUDIT_ACE_TYPE = 0x2; 2281 public const int S_ALLTHRESHOLD = 2; 2282 public const int S_LEGATO = 1; 2283 public const int S_NORMAL = 0; 2284 public const int S_PERIOD1024 = 1; 2285 public const int S_PERIOD2048 = 2; 2286 public const int S_PERIOD512 = 0; 2287 public const int S_PERIODVOICE = 3; 2288 public const int S_QUEUEEMPTY = 0; 2289 public const int S_SERBDNT = (-5); 2290 public const int S_SERDCC = (-7); 2291 public const int S_SERDDR = (-14); 2292 public const int S_SERDFQ = (-13); 2293 public const int S_SERDLN = (-6); 2294 public const int S_SERDMD = (-10); 2295 public const int S_SERDPT = (-12); 2296 public const int S_SERDSH = (-11); 2297 public const int S_SERDSR = (-15); 2298 public const int S_SERDST = (-16); 2299 public const int S_SERDTP = (-8); 2300 public const int S_SERDVL = (-9); 2301 public const int S_SERDVNA = (-1); 2302 public const int S_SERMACT = (-3); 2303 public const int S_SEROFM = (-2); 2304 public const int S_SERQFUL = (-4); 2305 public const int S_STACCATO = 2; 2306 public const int S_THRESHOLD = 1; 2307 public const int S_WHITE1024 = 5; 2308 public const int S_WHITE2048 = 6; 2309 public const int S_WHITE512 = 4; 2310 public const int S_WHITEVOICE = 7; 2311 public const int SecurityAnonymous = 1; 2312 public const int SecurityIdentification = 2; 2313 public const int SidTypeAlias = 4; 2314 public const int SidTypeDeletedAccount = 6; 2315 public const int SidTypeDomain = 3; 2316 public const int SidTypeGroup = 2; 2317 public const int SidTypeInvalid = 7; 2318 public const int SidTypeUnknown = 8; 2319 public const int SidTypeUser = 1; 2320 public const int SidTypeWellKnownGroup = 5; 2321 public const int TC_GP_TRAP = 2; 2322 public const int TC_HARDERR = 1; 2323 public const int TC_NORMAL = 0; 2324 public const int TC_SIGNAL = 3; 2325 public const int TF_FORCEDRIVE = 0x80; 2326 public const int THREAD_BASE_PRIORITY_IDLE = -15; 2327 public const int THREAD_BASE_PRIORITY_LOWRT = 15; 2328 public const int THREAD_BASE_PRIORITY_MAX = 2; 2329 public const int THREAD_BASE_PRIORITY_MIN = -2; 2330 public const int THREAD_PRIORITY_ABOVE_NORMAL = (THREAD_PRIORITY_HIGHEST - 1); 2331 public const int THREAD_PRIORITY_BELOW_NORMAL = (THREAD_PRIORITY_LOWEST + 1); 2332 public const int THREAD_PRIORITY_ERROR_RETURN = (MAXLONG); 2333 public const int THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX; 2334 public const int THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE; 2335 public const int THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN; 2336 public const int THREAD_PRIORITY_NORMAL = 0; 2337 public const int THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT; 2338 public const int TIME_FORCE24HOURFORMAT = 0x8; 2339 public const int TIME_NOMINUTESORSECONDS = 0x1; 2340 public const int TIME_NOSECONDS = 0x2; 2341 public const int TIME_NOTIMEMARKER = 0x4; 2342 public const int TLS_OUT_OF_INDEXES = 0xFFFF; 2343 public const int TRUNCATE_EXISTING = 5; 2344 public const int TWOSTOPBITS = 2; 2345 public const int TokenDefaultDacl = 6; 2346 public const int TokenGroups = 2; 2347 public const int TokenImpersonationLevel = 9; 2348 public const int TokenOwner = 4; 2349 public const int TokenPrimaryGroup = 5; 2350 public const int TokenPrivileges = 3; 2351 public const int TokenSource = 7; 2352 public const int TokenStatistics = 10; 2353 public const int TokenType = 8; 2354 public const int TokenUser = 1; 2355 public const int UNLOAD_DLL_DEBUG_EVENT = 7; 2356 public const int VALID_INHERIT_FLAGS = 0xF; 2357 public const int VER_PLATFORM_WIN32_NT = 2; 2358 public const int VER_PLATFORM_WIN32_WINDOWS = 1; 2359 public const int VER_PLATFORM_WIN32s = 0; 2360 public const int WC_COMPOSITECHECK = 0x200; 2361 public const int WC_DEFAULTCHAR = 0x40; 2362 public const int WC_DEFAULTCHECK = 0x100; 2363 public const int WC_DISCARDNS = 0x10; 2364 public const int WC_SEPCHARS = 0x20; 2365 public const int WINDOW_BUFFER_SIZE_EVENT = 0x4; 2366 public const int WRITE_DAC = 0x40000; 2367 public const int WRITE_OWNER = 0x80000; 2368 public const int mouse_eventC = 0x2; 2369 public const string SC_GROUP_IDENTIFIER = "+"; 2370 public const string SERVICES_ACTIVE_DATABASE = "ServicesActive"; 2371 public const string SERVICES_FAILED_DATABASE = "ServicesFailed"; 2372 public const string SE_ASSIGNPRIMARYTOKEN_NAME = "SeAssignPrimaryTokenPrivilege"; 2373 public const string SE_AUDIT_NAME = "SeAuditPrivilege"; 2374 public const string SE_BACKUP_NAME = "SeBackupPrivilege"; 2375 public const string SE_CHANGE_NOTIFY_NAME = "SeChangeNotifyPrivilege"; 2376 public const string SE_CREATE_PAGEFILE_NAME = "SeCreatePagefilePrivilege"; 2377 public const string SE_CREATE_PERMANENT_NAME = "SeCreatePermanentPrivilege"; 2378 public const string SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege"; 2379 public const string SE_DEBUG_NAME = "SeDebugPrivilege"; 2380 public const string SE_INCREASE_QUOTA_NAME = "SeIncreaseQuotaPrivilege"; 2381 public const string SE_INC_BASE_PRIORITY_NAME = "SeIncreaseBasePriorityPrivilege"; 2382 public const string SE_LOAD_DRIVER_NAME = "SeLoadDriverPrivilege"; 2383 public const string SE_LOCK_MEMORY_NAME = "SeLockMemoryPrivilege"; 2384 public const string SE_MACHINE_ACCOUNT_NAME = "SeMachineAccountPrivilege"; 2385 public const string SE_PROF_SINGLE_PROCESS_NAME = "SeProfileSingleProcessPrivilege"; 2386 public const string SE_REMOTE_SHUTDOWN_NAME = "SeRemoteShutdownPrivilege"; 2387 public const string SE_RESTORE_NAME = "SeRestorePrivilege"; 2388 public const string SE_SECURITY_NAME = "SeSecurityPrivilege"; 2389 public const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege"; 2390 public const string SE_SYSTEMTIME_NAME = "SeSystemtimePrivilege"; 2391 public const string SE_SYSTEM_ENVIRONMENT_NAME = "SeSystemEnvironmentPrivilege"; 2392 public const string SE_SYSTEM_PROFILE_NAME = "SeSystemProfilePrivilege"; 2393 public const string SE_TAKE_OWNERSHIP_NAME = "SeTakeOwnershipPrivilege"; 2394 public const string SE_TCB_NAME = "SeTcbPrivilege"; 2395 public const string SE_UNSOLICITED_INPUT_NAME = "SeUnsolicitedInputPrivilege"; 2396 } 2397 }
User.cs
1 using System; 2 using System.Runtime.InteropServices; 3 using System.Text; 4 5 using HANDLE = System.IntPtr; 6 using HWND = System.IntPtr; 7 using HDC = System.IntPtr; 8 9 namespace Win32 10 { 11 public struct CBTACTIVATESTRUCT 12 { 13 public int fMouse; 14 public HWND hwndActive; 15 } 16 public struct EVENTMSG 17 { 18 public int message; 19 public int paramL; 20 public int paramH; 21 public int time; 22 public HWND hwnd; 23 } 24 public struct CWPSTRUCT 25 { 26 public int lParam; 27 public int wParam; 28 public int message; 29 public HWND hwnd; 30 } 31 public struct DEBUGHOOKINFO 32 { 33 public HANDLE hModuleHook; 34 public int Reserved; 35 public int lParam; 36 public int wParam; 37 public int code; 38 } 39 public struct MOUSEHOOKSTRUCT 40 { 41 public POINT pt; 42 public HWND hwnd; 43 public int wHitTestCode; 44 public int dwExtraInfo; 45 } 46 public struct MINMAXINFO 47 { 48 public POINT ptReserved; 49 public POINT ptMaxSize; 50 public POINT ptMaxPosition; 51 public POINT ptMinTrackSize; 52 public POINT ptMaxTrackSize; 53 } 54 public struct COPYDATASTRUCT 55 { 56 public int dwData; 57 public int cbData; 58 public int lpData; 59 } 60 public struct WINDOWPOS 61 { 62 public HWND hwnd; 63 public HWND hwndInsertAfter; 64 public int x; 65 public int y; 66 public int cx; 67 public int cy; 68 public int flags; 69 } 70 public struct ACCEL 71 { 72 public byte fVirt; 73 public short key; 74 public short cmd; 75 } 76 public struct PAINTSTRUCT 77 { 78 public HDC hdc; 79 public int fErase; 80 public RECT rcPaint; 81 public int fRestore; 82 public int fIncUpdate; 83 [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] public byte rgbReserved; 84 } 85 public struct CREATESTRUCT 86 { 87 public int lpCreateParams; 88 public HANDLE hInstance; 89 public HANDLE hMenu; 90 public HWND hwndParent; 91 public int cy; 92 public int cx; 93 public int y; 94 public int x; 95 public int style; 96 public string lpszName; 97 public string lpszClass; 98 public int ExStyle; 99 } 100 public struct CBT_CREATEWND 101 { 102 public CREATESTRUCT lpcs; 103 public HWND hwndInsertAfter; 104 } 105 public struct WINDOWPLACEMENT 106 { 107 public int Length; 108 public int flags; 109 public int showCmd; 110 public POINT ptMinPosition; 111 public POINT ptMaxPosition; 112 public RECT rcNormalPosition; 113 } 114 public struct MEASUREITEMSTRUCT 115 { 116 public int CtlType; 117 public int CtlID; 118 public int itemID; 119 public int itemWidth; 120 public int itemHeight; 121 public int itemData; 122 } 123 public struct DRAWITEMSTRUCT 124 { 125 public int CtlType; 126 public int CtlID; 127 public int itemID; 128 public int itemAction; 129 public int itemState; 130 public HWND hwndItem; 131 public HDC hdc; 132 public RECT rcItem; 133 public int itemData; 134 } 135 public struct DELETEITEMSTRUCT 136 { 137 public int CtlType; 138 public int CtlID; 139 public int itemID; 140 public HWND hwndItem; 141 public int itemData; 142 } 143 public struct COMPAREITEMSTRUCT 144 { 145 public int CtlType; 146 public int CtlID; 147 public HWND hwndItem; 148 public int itemID1; 149 public int itemData1; 150 public int itemID2; 151 public int itemData2; 152 } 153 public struct MSG 154 { 155 public HWND hwnd; 156 public int message; 157 public int wParam; 158 public int lParam; 159 public int time; 160 public POINT pt; 161 } 162 public struct WNDCLASS 163 { 164 public int style; 165 public int lpfnwndproc; 166 public int cbClsextra; 167 public int cbWndExtra2; 168 public HANDLE hInstance; 169 public HANDLE hIcon; 170 public HANDLE hCursor; 171 public HANDLE hbrBackground; 172 public string lpszMenuName; 173 public string lpszClassName; 174 } 175 public struct DLGTEMPLATE 176 { 177 public int style; 178 public int dwExtendedStyle; 179 public short cdit; 180 public short x; 181 public short y; 182 public short cx; 183 public short cy; 184 } 185 public struct DLGITEMTEMPLATE 186 { 187 public int style; 188 public int dwExtendedStyle; 189 public short x; 190 public short y; 191 public short cx; 192 public short cy; 193 public short id; 194 } 195 public struct MENUITEMTEMPLATEHEADER 196 { 197 public short versionNumber; 198 public short offset; 199 } 200 public struct MENUITEMTEMPLATE 201 { 202 public short mtOption; 203 public short mtID; 204 public byte mtString; 205 } 206 public struct ICONINFO 207 { 208 public int fIcon; 209 public int xHotspot; 210 public int yHotspot; 211 public HANDLE hbmMask; 212 public HANDLE hbmColor; 213 } 214 public struct MDICREATESTRUCT 215 { 216 public string szClass; 217 public string szTitle; 218 public HWND hOwner; 219 public int x; 220 public int y; 221 public int cx; 222 public int cy; 223 public int style; 224 public int lParam; 225 } 226 public struct CLIENTCREATESTRUCT 227 { 228 public HANDLE hWindowMenu; 229 public int idFirstChild; 230 } 231 public struct MULTIKEYHELP 232 { 233 public int mkSize; 234 public byte mkKeylist; 235 [MarshalAs(UnmanagedType.ByValTStr, SizeConst=253)] public string szKeyphrase; 236 } 237 public struct HELPWININFO 238 { 239 public int wStructSize; 240 public int x; 241 public int y; 242 public int dx; 243 public int dy; 244 public int wMax; 245 [MarshalAs(UnmanagedType.ByValTStr, SizeConst=2)] public string rgchMember; 246 } 247 public struct DDEACK 248 { 249 public short bAppReturnCode; 250 public short Reserved; 251 public short fbusy; 252 public short fack; 253 } 254 public struct DDEADVISE 255 { 256 public short Reserved; 257 public short fDeferUpd; 258 public short fAckReq; 259 public short cfFormat; 260 } 261 public struct DDEDATA 262 { 263 public short unused; 264 public short fresponse; 265 public short fRelease; 266 public short Reserved; 267 public short fAckReq; 268 public short cfFormat; 269 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public byte Value; 270 } 271 public struct DDEPOKE 272 { 273 public short unused; 274 public short fRelease; 275 public short fReserved; 276 public short cfFormat; 277 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public byte Value; 278 } 279 public struct DDELN 280 { 281 public short unused; 282 public short fRelease; 283 public short fDeferUpd; 284 public short fAckReq; 285 public short cfFormat; 286 } 287 public struct DDEUP 288 { 289 public short unused; 290 public short fAck; 291 public short fRelease; 292 public short fReserved; 293 public short fAckReq; 294 public short cfFormat; 295 [MarshalAs(UnmanagedType.ByValArray, SizeConst=1)] public byte rgb; 296 } 297 public struct HSZPAIR 298 { 299 public HANDLE hszSvc; 300 public HANDLE hszTopic; 301 } 302 public struct SECURITY_QUALITY_OF_SERVICE 303 { 304 public int Length; 305 public short Impersonationlevel; 306 public short ContextTrackingMode; 307 public int EffectiveOnly; 308 } 309 public struct CONVCONTEXT 310 { 311 public int cb; 312 public int wFlags; 313 public int wCountryID; 314 public int iCodePage; 315 public int dwLangID; 316 public int dwSecurity; 317 public SECURITY_QUALITY_OF_SERVICE qos; 318 } 319 public struct CONVINFO 320 { 321 public int cb; 322 public HANDLE hUser; 323 public HANDLE hConvPartner; 324 public HANDLE hszSvcPartner; 325 public HANDLE hszServiceReq; 326 public HANDLE hszTopic; 327 public HANDLE hszItem; 328 public int wFmt; 329 public int wType; 330 public int wStatus; 331 public int wConvst; 332 public int wLastError; 333 public HANDLE hConvList; 334 public CONVCONTEXT ConvCtxt; 335 public HWND hwnd; 336 public HWND hwndPartner; 337 } 338 public struct DDEML_MSG_HOOK_DATA 339 { 340 public int uiLo; 341 public int uiHi; 342 public int cbData; 343 [MarshalAs(UnmanagedType.ByValArray, SizeConst=8)] public int Data; 344 } 345 public struct MONMSGSTRUCT 346 { 347 public int cb; 348 public HWND hwndTo; 349 public int dwTime; 350 public HANDLE htask; 351 public int wMsg; 352 public int wParam; 353 public int lParam; 354 public DDEML_MSG_HOOK_DATA dmhd; 355 } 356 public struct MONCBSTRUCT 357 { 358 public int cb; 359 public int dwTime; 360 public HANDLE htask; 361 public int dwRet; 362 public int wType; 363 public int wFmt; 364 public HANDLE hConv; 365 public HANDLE hsz1; 366 public HANDLE hsz2; 367 public HANDLE hData; 368 public int dwData1; 369 public int dwData2; 370 public CONVCONTEXT cc; 371 public int cbData; 372 [MarshalAs(UnmanagedType.ByValArray, SizeConst=8)] public int Data; 373 } 374 public struct MONHSZSTRUCT 375 { 376 public int cb; 377 public int fsAction; 378 public int dwTime; 379 public HANDLE hsz; 380 public HANDLE htask; 381 public byte str; 382 } 383 public struct MONERRSTRUCT 384 { 385 public int cb; 386 public int wLastError; 387 public int dwTime; 388 public HANDLE htask; 389 } 390 public struct MONLINKSTRUCT 391 { 392 public int cb; 393 public int dwTime; 394 public HANDLE htask; 395 public int fEstablished; 396 public int fNoData; 397 public HANDLE hszSvc; 398 public HANDLE hszTopic; 399 public HANDLE hszItem; 400 public int wFmt; 401 public int fServer; 402 public HANDLE hConvServer; 403 public HANDLE hConvClient; 404 } 405 public struct MONCONVSTRUCT 406 { 407 public int cb; 408 public int fConnect; 409 public int dwTime; 410 public HANDLE htask; 411 public HANDLE hszSvc; 412 public HANDLE hszTopic; 413 public HANDLE hConvClient; 414 public HANDLE hConvServer; 415 } 416 public struct DRAWTEXTPARAMS 417 { 418 public int cbSize; 419 public int iTabLength; 420 public int iLeftMargin; 421 public int iRightMargin; 422 public int uiLengthDrawn; 423 } 424 public struct MENUITEMINFO 425 { 426 public int cbSize; 427 public int fMask; 428 public int fType; 429 public int fState; 430 public int wID; 431 public HANDLE hSubMenu; 432 public HANDLE hbmpChecked; 433 public HANDLE hbmpUnchecked; 434 public int dwItemData; 435 public string dwTypeData; 436 public int cch; 437 } 438 public struct SCROLLINFO 439 { 440 public int cbSize; 441 public int fMask; 442 public int nMin; 443 public int nMax; 444 public int nPage; 445 public int nPos; 446 public int nTrackPos; 447 } 448 public struct MSGBOXPARAMS 449 { 450 public int cbSize; 451 public HWND hwndOwner; 452 public HANDLE hInstance; 453 public string lpszText; 454 public string lpszCaption; 455 public int dwStyle; 456 public string lpszIcon; 457 public int dwContextHelpId; 458 public int lpfnMsgBoxCallback; 459 public int dwLanguageId; 460 } 461 public struct WNDCLASSEX 462 { 463 public int cbSize; 464 public int style; 465 public int lpfnWndProc; 466 public int cbClsExtra; 467 public int cbWndExtra; 468 public HANDLE hInstance; 469 public HANDLE hIcon; 470 public HANDLE hCursor; 471 public HANDLE hbrBackground; 472 public string lpszMenuName; 473 public string lpszClassName; 474 public HANDLE hIconSm; 475 } 476 public struct TPMPARAMS 477 { 478 public int cbSize; 479 public RECT rcExclude; 480 } 481 public struct BROWSEINFO 482 { 483 public HWND hwndOwner; 484 public int pIDLRoot; 485 public int pszDisplayName; 486 public int lpszTitle; 487 public int ulFlags; 488 public int lpfnCallback; 489 public int lParam; 490 public int iImage; 491 } 492 493 public abstract class ComCtl 494 { 495 [DllImport("COMCTL32")] public static extern int ImageList_AddIcon(HANDLE himl, HANDLE hIcon); 496 [DllImport("COMCTL32")] public static extern int ImageList_Create(int MinCx, int MinCy, int flags, int cInitial, int cGrow); 497 [DllImport("COMCTL32")] public static extern int ImageList_Draw(HANDLE hIMAGELIST, int ImgIndex, HWND hdcDest, int xDest, int yDest, int lStyle); 498 [DllImport("COMCTL32")] public static extern int ImageList_GetIcon(HANDLE hIMAGELIST, int ImgIndex, HANDLE hbmMask); 499 [DllImport("COMCTL32")] public static extern int InitCommonControls(); 500 } 501 502 public abstract class Ole 503 { 504 [DllImport("ole32")] public static extern int OleInitialize(IntPtr vbNullString); 505 [DllImport("ole32")] public static extern void CoTaskMemFree(HANDLE hMem); 506 [DllImport("ole32")] public static extern void OleUninitialize(); 507 } 508 509 public class User 510 { 511 [DllImport("advapi32")] public static extern int SetServiceBits(HANDLE hServiceStatus, int dwServiceBits, int bSetBitsOn, int bUpdateImmediately); 512 [DllImport("kernel32")] public static extern int SetSystemTimeAdjustment(int dwTimeAdjustment, int bTimeAdjustmentDisabled); 513 [DllImport("mpr")] public static extern int WNetGetUniversalName(string lpLocalPath, int dwInfoLevel, StringBuilder lpBuffer, ref int lpBufferSize); 514 [DllImport("user32")] public static extern int ActivateKeyboardLayout(HANDLE hKL, int flags); 515 [DllImport("user32")] public static extern int AdjustWindowRect(ref RECT lpRect, int dwStyle, int bMenu); 516 [DllImport("user32")] public static extern int AdjustWindowRectEx(ref RECT lpRect, int dsStyle, int bMenu, int dwEsStyle); 517 [DllImport("user32")] public static extern int AnyPopup(); 518 [DllImport("user32")] public static extern int AppendMenu(HANDLE hMenu, int wFlags, int wIDNewItem, IntPtr lpNewItem); 519 [DllImport("user32")] public static extern int ArrangeIconicWindows(HWND hwnd); 520 [DllImport("user32")] public static extern int AttachThreadInput(int idAttach, int idAttachTo, int fAttach); 521 [DllImport("user32")] public static extern int BeginDeferWindowPos(int nNumWindows); 522 [DllImport("user32")] public static extern int BeginPaint(HWND hwnd, ref PAINTSTRUCT lpPaint); 523 [DllImport("user32")] public static extern int BringWindowToTop(HWND hwnd); 524 [DllImport("user32")] public static extern int BroadcastSystemMessage(int dw, ref int pdw, int un, int wParam, int lParam); 525 [DllImport("user32")] public static extern int CallMsgFilter(ref MSG lpMsg, int ncode); 526 [DllImport("user32")] public static extern int CallNextHookEx(HANDLE hHook, int ncode, int wParam, IntPtr lParam); 527 [DllImport("user32")] public static extern int CallWindowProc(int lpPrevWndFunc, HWND hwnd, int Msg, int wParam, int lParam); 528 [DllImport("user32")] public static extern int ChangeClipboardChain(HWND hwnd, HWND hwndNext); 529 [DllImport("user32")] public static extern int ChangeMenu(HANDLE hMenu, int cmd, string lpszNewItem, int cmdInsert, int flags); 530 [DllImport("user32")] public static extern int CharLowerBuff(string lpsz, int cchLength); 531 [DllImport("user32")] public static extern int CharToOem(string lpszSrc, string lpszDst); 532 [DllImport("user32")] public static extern int CharToOemBuff(string lpszSrc, string lpszDst, int cchDstLength); 533 [DllImport("user32")] public static extern int CharUpperBuff(string lpsz, int cchLength); 534 [DllImport("user32")] public static extern int CheckDlgButton(HANDLE hDlg, int nIDButton, int wCheck); 535 [DllImport("user32")] public static extern int CheckMenuItem(HANDLE hMenu, int wIDCheckItem, int wCheck); 536 [DllImport("user32")] public static extern int CheckMenuRadioItem(HANDLE hMenu, int un1, int un2, int un3, int un4); 537 [DllImport("user32")] public static extern int CheckRadioButton(HANDLE hDlg, int nIDFirstButton, int nIDLastButton, int nIDCheckButton); 538 [DllImport("user32")] public static extern int ChildWindowFromPoint(HWND hwnd, int xPoint, int yPoint); 539 [DllImport("user32")] public static extern int ChildWindowFromPointEx(HWND hwnd, int xPoint, int yPoint, int un); 540 [DllImport("user32")] public static extern int ClientToScreen(HWND hwnd, ref POINT lpPoint); 541 [DllImport("user32")] public static extern int ClipCursor(ref RECT lpRect); 542 [DllImport("user32")] public static extern int CloseClipboard(); 543 [DllImport("user32")] public static extern int CloseDesktop(HANDLE hDesktop); 544 [DllImport("user32")] public static extern int CloseWindow(HWND hwnd); 545 [DllImport("user32")] public static extern int CloseWindowStation(HANDLE hWinSta); 546 [DllImport("user32")] public static extern int CopyAcceleratorTable(HANDLE hAccelSrc, ACCEL[] lpAccelDst, int cAccelEntries); 547 [DllImport("user32")] public static extern int CopyCursor(HANDLE hcur); 548 [DllImport("user32")] public static extern int CopyIcon(HANDLE hIcon); 549 [DllImport("user32")] public static extern int CopyImage(HANDLE handle, int un1, int n1, int n2, int un2); 550 [DllImport("user32")] public static extern int CopyRect(ref RECT lpDestRect, ref RECT lpSourceRect); 551 [DllImport("user32")] public static extern int CountClipboardFormats(); 552 [DllImport("user32")] public static extern int CreateAcceleratorTable(ref ACCEL lpaccl, int cEntries); 553 [DllImport("user32")] public static extern int CreateCaret(HWND hwnd, HANDLE hBitmap, int nWidth, int nHeight); 554 [DllImport("user32")] public static extern int CreateCursor(HANDLE hInstance, int nXhotspot, int nYhotspot, int nWidth, int nHeight, IntPtr lpANDbitPlane, IntPtr lpXORbitPlane); 555 [DllImport("user32")] public static extern int CreateDesktop(string lpszDesktop, string lpszDevice, ref DEVMODE pDevmode, int dwFlags, int dwDesiredAccess, ref SECURITY_ATTRIBUTES lpsa); 556 [DllImport("user32")] public static extern int CreateDialogIndirectParam(HANDLE hInstance, ref DLGTEMPLATE lpTemplate, HWND hwndParent, ref int lpDialogFunc, int dwInitParam); 557 [DllImport("user32")] public static extern int CreateDialogParam(HANDLE hInstance, string lpName, HWND hwndParent, ref int lpDialogFunc, int lParamInit); 558 [DllImport("user32")] public static extern int CreateIcon(HANDLE hInstance, int nWidth, int nHeight, Byte nPlanes, Byte nBitsPixel, Byte lpANDbits, Byte lpXORbits); 559 [DllImport("user32")] public static extern int CreateIconFromResource(Byte presbits, int dwResSize, int fIcon, int dwVer); 560 [DllImport("user32")] public static extern int CreateIconIndirect(ref ICONINFO piconinfo); 561 [DllImport("user32")] public static extern int CreateMDIWindow(string lpClassName, string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, HWND hwndParent, HANDLE hInstance, int lParam); 562 [DllImport("user32")] public static extern int CreateMenu(); 563 [DllImport("user32")] public static extern int CreatePopupMenu(); 564 [DllImport("user32")] public static extern int CreateWindowEx(int dwExStyle, string lpClassName, string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, HWND hwndParent, HANDLE hMenu, HANDLE hInstance, IntPtr lpParam); 565 [DllImport("user32")] public static extern int DdeAbandonTransaction(int idInst, HANDLE hConv, int idTransaction); 566 [DllImport("user32")] public static extern int DdeAccessData(HANDLE hData, ref int pcbDataSize); 567 [DllImport("user32")] public static extern int DdeAddData(HANDLE hData, Byte pSrc, int cb, int cbOff); 568 [DllImport("user32")] public static extern int DdeClientTransaction(Byte pData, int cbData, HANDLE hConv, HANDLE hszItem, int wFmt, int wType, int dwTimeout, ref int pdwResult); 569 [DllImport("user32")] public static extern int DdeCmpStringHandles(HANDLE hsz1, HANDLE hsz2); 570 [DllImport("user32")] public static extern int DdeConnect(int idInst, HANDLE hszService, HANDLE hszTopic, ref CONVCONTEXT pCC); 571 [DllImport("user32")] public static extern int DdeConnectList(int idInst, HANDLE hszService, HANDLE hszTopic, HANDLE hConvList, ref CONVCONTEXT pCC); 572 [DllImport("user32")] public static extern int DdeCreateDataHandle(int idInst, Byte pSrc, int cb, int cbOff, HANDLE hszItem, int wFmt, int afCmd); 573 [DllImport("user32")] public static extern int DdeCreateStringHandle(int idInst, string psz, int iCodePage); 574 [DllImport("user32")] public static extern int DdeDisconnect(HANDLE hConv); 575 [DllImport("user32")] public static extern int DdeDisconnectList(HANDLE hConvList); 576 [DllImport("user32")] public static extern int DdeEnableCallback(int idInst, HANDLE hConv, int wCmd); 577 [DllImport("user32")] public static extern int DdeFreeDataHandle(HANDLE hData); 578 [DllImport("user32")] public static extern int DdeFreeStringHandle(int idInst, HANDLE hsz); 579 [DllImport("user32")] public static extern int DdeGetData(HANDLE hData, Byte pDst, int cbMax, int cbOff); 580 [DllImport("user32")] public static extern int DdeGetLastError(int idInst); 581 [DllImport("user32")] public static extern int DdeImpersonateClient(HANDLE hConv); 582 [DllImport("user32")] public static extern int DdeKeepStringHandle(int idInst, HANDLE hsz); 583 [DllImport("user32")] public static extern int DdeNameService(int idInst, HANDLE hsz1, HANDLE hsz2, int afCmd); 584 [DllImport("user32")] public static extern int DdePostAdvise(int idInst, HANDLE hszTopic, HANDLE hszItem); 585 [DllImport("user32")] public static extern int DdeQueryConvInfo(HANDLE hConv, int idTransaction, ref CONVINFO pConvInfo); 586 [DllImport("user32")] public static extern int DdeQueryNextServer(HANDLE hConvList, HANDLE hConvPrev); 587 [DllImport("user32")] public static extern int DdeQueryString(int idInst, HANDLE hsz, string psz, int cchMax, int iCodePage); 588 [DllImport("user32")] public static extern int DdeReconnect(HANDLE hConv); 589 [DllImport("user32")] public static extern int DdeSetQualityOfService(HWND hwndClient, ref SECURITY_QUALITY_OF_SERVICE pqosNew, ref SECURITY_QUALITY_OF_SERVICE pqosPrev); 590 [DllImport("user32")] public static extern int DdeSetUserHandle(HANDLE hConv, int id, HANDLE hUser); 591 [DllImport("user32")] public static extern int DdeUnaccessData(HANDLE hData); 592 [DllImport("user32")] public static extern int DdeUninitialize(int idInst); 593 [DllImport("user32")] public static extern int DefDlgProc(HANDLE hDlg, int wMsg, int wParam, int lParam); 594 [DllImport("user32")] public static extern int DefFrameProc(HWND hwnd, HWND hwndMDIClient, int wMsg, int wParam, int lParam); 595 [DllImport("user32")] public static extern int DefMDIChildProc(HWND hwnd, int wMsg, int wParam, int lParam); 596 [DllImport("user32")] public static extern int DefWindowProc(HWND hwnd, int wMsg, int wParam, int lParam); 597 [DllImport("user32")] public static extern int DeferWindowPos(HANDLE hWinPosInfo, HWND hwnd, HWND hwndInsertAfter, int x, int y, int cx, int cy, int wFlags); 598 [DllImport("user32")] public static extern int DeleteMenu(HANDLE hMenu, int nPosition, int wFlags); 599 [DllImport("user32")] public static extern int DestroyAcceleratorTable(HANDLE haccel); 600 [DllImport("user32")] public static extern int DestroyCaret(); 601 [DllImport("user32")] public static extern int DestroyCursor(HANDLE hCursor); 602 [DllImport("user32")] public static extern int DestroyIcon(HANDLE hIcon); 603 [DllImport("user32")] public static extern int DestroyMenu(HANDLE hMenu); 604 [DllImport("user32")] public static extern int DestroyWindow(HWND hwnd); 605 [DllImport("user32")] public static extern int DialogBoxIndirectParam(HANDLE hInstance, DLGTEMPLATE hDialogTemplate, HWND hwndParent, ref int lpDialogFunc, int dwInitParam); 606 [DllImport("user32")] public static extern int DispatchMessage(ref MSG lpMsg); 607 [DllImport("user32")] public static extern int DlgDirList(HANDLE hDlg, string lpPathSpec, int nIDListBox, int nIDStaticPath, int wFileType); 608 [DllImport("user32")] public static extern int DlgDirListComboBox(HANDLE hDlg, string lpPathSpec, int nIDComboBox, int nIDStaticPath, int wFileType); 609 [DllImport("user32")] public static extern int DlgDirSelectComboBoxEx(HWND hwndDlg, string lpszPath, int cbPath, int idComboBox); 610 [DllImport("user32")] public static extern int DlgDirSelectEx(HWND hwndDlg, string lpszPath, int cbPath, int idListBox); 611 [DllImport("user32")] public static extern int DragDetect(HWND hwnd, POINT pt); 612 [DllImport("user32")] public static extern int DragObject(HWND hwnd1, HWND hwnd2, int un, int dw, HANDLE hCursor); 613 [DllImport("user32")] public static extern int DrawAnimatedRects(HWND hwnd, int idAni, ref RECT lprcFrom, ref RECT lprcTo); 614 [DllImport("user32")] public static extern int DrawCaption(HWND hwnd, HWND hdc, ref RECT pcRect, int un); 615 [DllImport("user32")] public static extern int DrawEdge(HDC hdc, ref RECT qrc, int edge, int grfFlags); 616 [DllImport("user32")] public static extern int DrawFocusRect(HDC hdc, ref RECT lpRect); 617 [DllImport("user32")] public static extern int DrawFrameControl(HWND hdc, ref RECT lpRect, int un1, int un2); 618 [DllImport("user32")] public static extern int DrawIcon(HDC hdc, int x, int y, HANDLE hIcon); 619 [DllImport("user32")] public static extern int DrawIconEx(HDC hdc, int xLeft, int yTop, HANDLE hIcon, int cxWidth, int cyWidth, int istepIfAniCur, HANDLE hbrFlickerFreeDraw, int diFlags); 620 [DllImport("user32")] public static extern int DrawMenuBar(HWND hwnd); 621 [DllImport("user32")] public static extern int DrawState(HWND hdc, HANDLE hBrush, ref int lpDrawStateProc, int lParam, int wParam, int n1, int n2, int n3, int n4, int un); 622 [DllImport("user32")] public static extern int DrawText(HDC hdc, string lpStr, int nCount, ref RECT lpRect, int wFormat); 623 [DllImport("user32")] public static extern int DrawTextEx(HWND hdc, string lpsz, int n, ref RECT lpRect, int un, ref DRAWTEXTPARAMS lpDrawTextParams); 624 [DllImport("user32")] public static extern int EmptyClipboard(); 625 [DllImport("user32")] public static extern int EnableMenuItem(HANDLE hMenu, int wIDEnableItem, int wEnable); 626 [DllImport("user32")] public static extern int EnableScrollBar(HWND hwnd, int wSBflags, int wArrows); 627 [DllImport("user32")] public static extern int EnableWindow(HWND hwnd, int fEnable); 628 [DllImport("user32")] public static extern int EndDeferWindowPos(HANDLE hWinPosInfo); 629 [DllImport("user32")] public static extern int EndDialog(HANDLE hDlg, int nResult); 630 [DllImport("user32")] public static extern int EndPaint(HWND hwnd, ref PAINTSTRUCT lpPaint); 631 [DllImport("user32")] public static extern int EnumChildWindows(HWND hwndParent, ref int lpEnumFunc, int lParam); 632 [DllImport("user32")] public static extern int EnumClipboardFormats(int wFormat); 633 [DllImport("user32")] public static extern int EnumDesktopWindows(HANDLE hDesktop, ref int lpfn, int lParam); 634 [DllImport("user32")] public static extern int EnumDesktops(HANDLE hwinsta, ref int lpEnumFunc, int lParam); 635 [DllImport("user32")] public static extern int EnumProps(HWND hwnd, ref int lpEnumFunc); 636 [DllImport("user32")] public static extern int EnumPropsEx(HWND hwnd, ref int lpEnumFunc, int lParam); 637 [DllImport("user32")] public static extern int EnumThreadWindows(int dwThreadId, ref int lpfn, int lParam); 638 [DllImport("user32")] public static extern int EnumWindowStations(int lpEnumFunc, int lParam); 639 [DllImport("user32")] public static extern int EnumWindows(int lpEnumFunc, int lParam); 640 [DllImport("user32")] public static extern int EqualRect(ref RECT lpRect1, ref RECT lpRect2); 641 [DllImport("user32")] public static extern int ExcludeUpdateRgn(HDC hdc, HWND hwnd); 642 [DllImport("user32")] public static extern int ExitWindows(int dwReserved, int uReturnCode); 643 [DllImport("user32")] public static extern int ExitWindowsEx(int uFlags, int dwReserved); 644 [DllImport("user32")] public static extern int FillRect(HDC hdc, ref RECT lpRect, HANDLE hBrush); 645 [DllImport("user32")] public static extern int FindWindow(string lpClassName, string lpWindowName); 646 [DllImport("user32")] public static extern int FindWindowEx(HWND hwnd1, HWND hwnd2, string lpsz1, string lpsz2); 647 [DllImport("user32")] public static extern int FlashWindow(HWND hwnd, int bInvert); 648 [DllImport("user32")] public static extern int FrameRect(HDC hdc, ref RECT lpRect, HANDLE hBrush); 649 [DllImport("user32")] public static extern int FreeDDElParam(int msg, int lParam); 650 [DllImport("user32")] public static extern int GetActiveWindow(); 651 [DllImport("user32")] public static extern int GetCapture(); 652 [DllImport("user32")] public static extern int GetCaretBlinkTime(); 653 [DllImport("user32")] public static extern int GetCaretPos(ref POINT lpPoint); 654 [DllImport("user32")] public static extern int GetClassInfo(HANDLE hInstance, string lpClassName, out WNDCLASS lpWndClass); 655 [DllImport("user32")] public static extern int GetClassLong(HWND hwnd, int nIndex); 656 [DllImport("user32")] public static extern int GetClassName(HWND hwnd, string lpClassName, int nMaxCount); 657 [DllImport("user32")] public static extern int GetClassWord(HWND hwnd, int nIndex); 658 [DllImport("user32")] public static extern int GetClientRect(HWND hwnd, ref RECT lpRect); 659 [DllImport("user32")] public static extern int GetClipCursor(out RECT lprc); 660 [DllImport("user32")] public static extern int GetClipboardData(int wFormat); 661 [DllImport("user32")] public static extern int GetClipboardFormatName(int wFormat, string lpString, int nMaxCount); 662 [DllImport("user32")] public static extern int GetClipboardOwner(); 663 [DllImport("user32")] public static extern int GetClipboardViewer(); 664 [DllImport("user32")] public static extern int GetCursor(); 665 [DllImport("user32")] public static extern int GetCursorPos(out POINT lpPoint); 666 [DllImport("user32")] public static extern int GetDC(HWND hwnd); 667 [DllImport("user32")] public static extern int GetDCEx(HWND hwnd, HANDLE hrgnclip, int fdwOptions); 668 [DllImport("user32")] public static extern int GetDesktopWindow(); 669 [DllImport("user32")] public static extern int GetDialogBaseUnits(); 670 [DllImport("user32")] public static extern int GetDlgCtrlID(HWND hwnd); 671 [DllImport("user32")] public static extern int GetDlgItem(HANDLE hDlg, int nIDDlgItem); 672 [DllImport("user32")] public static extern int GetDlgItemInt(HANDLE hDlg, int nIDDlgItem, ref int lpTranslated, int bSigned); 673 [DllImport("user32")] public static extern int GetDlgItemText(HANDLE hDlg, int nIDDlgItem, StringBuilder lpString, int nMaxCount); 674 [DllImport("user32")] public static extern int GetDoubleClickTime(); 675 [DllImport("user32")] public static extern int GetFocus(); 676 [DllImport("user32")] public static extern int GetForegroundWindow(); 677 [DllImport("user32")] public static extern int GetIconInfo(HANDLE hIcon, out ICONINFO piconinfo); 678 [DllImport("user32")] public static extern int GetInputState(); 679 [DllImport("user32")] public static extern int GetKBCodePage(); 680 [DllImport("user32")] public static extern int GetKeyNameText(int lParam, StringBuilder lpBuffer, int nSize); 681 [DllImport("user32")] public static extern int GetKeyboardLayout(int dwLayout); 682 [DllImport("user32")] public static extern int GetKeyboardLayoutList(int nBuff, ref int lpList); 683 [DllImport("user32")] public static extern int GetKeyboardLayoutName(string pwszKLID); 684 [DllImport("user32")] public static extern int GetKeyboardState(Byte pbKeyState); 685 [DllImport("user32")] public static extern int GetKeyboardType(int nTypeFlag); 686 [DllImport("user32")] public static extern int GetLastActivePopup(HWND hwndOwnder); 687 [DllImport("user32")] public static extern int GetMenu(HWND hwnd); 688 [DllImport("user32")] public static extern int GetMenuCheckMarkDimensions(); 689 [DllImport("user32")] public static extern int GetMenuContextHelpId(HANDLE hMenu); 690 [DllImport("user32")] public static extern int GetMenuDefaultItem(HANDLE hMenu, int fByPos, int gmdiFlags); 691 [DllImport("user32")] public static extern int GetMenuItemCount(HANDLE hMenu); 692 [DllImport("user32")] public static extern int GetMenuItemID(HANDLE hMenu, int nPos); 693 [DllImport("user32")] public static extern int GetMenuItemInfo(HANDLE hMenu, int un, int b, ref MENUITEMINFO lpMenuItemInfo); 694 [DllImport("user32")] public static extern int GetMenuItemRect(HWND hwnd, HANDLE hMenu, int uItem, ref RECT lprcItem); 695 [DllImport("user32")] public static extern int GetMenuState(HANDLE hMenu, int wID, int wFlags); 696 [DllImport("user32")] public static extern int GetMenuString(HANDLE hMenu, int wIDItem, StringBuilder lpString, int nMaxCount, int wFlag); 697 [DllImport("user32")] public static extern int GetMessage(ref MSG lpMsg, HWND hwnd, int wMsgFilterMin, int wMsgFilterMax); 698 [DllImport("user32")] public static extern int GetMessageExtraInfo(); 699 [DllImport("user32")] public static extern int GetMessagePos(); 700 [DllImport("user32")] public static extern int GetMessageTime(); 701 [DllImport("user32")] public static extern int GetNextDlgGroupItem(HANDLE hDlg, HANDLE hCtl, int bPrevious); 702 [DllImport("user32")] public static extern int GetNextDlgTabItem(HANDLE hDlg, HANDLE hCtl, int bPrevious); 703 [DllImport("user32")] public static extern int GetNextWindow(HWND hwnd, int wFlag); 704 [DllImport("user32")] public static extern int GetOpenClipboardWindow(); 705 [DllImport("user32")] public static extern int GetParent(HWND hwnd); 706 [DllImport("user32")] public static extern int GetPriorityClipboardFormat(int lpPriorityList, int nCount); 707 [DllImport("user32")] public static extern int GetProcessWindowStation(); 708 [DllImport("user32")] public static extern int GetProp(HWND hwnd, string lpString); 709 [DllImport("user32")] public static extern int GetQueueStatus(int fuFlags); 710 [DllImport("user32")] public static extern int GetScrollInfo(HWND hwnd, int n, ref SCROLLINFO lpScrollInfo); 711 [DllImport("user32")] public static extern int GetScrollPos(HWND hwnd, int nBar); 712 [DllImport("user32")] public static extern int GetScrollRange(HWND hwnd, int nBar, ref int lpMinPos, ref int lpMaxPos); 713 [DllImport("user32")] public static extern int GetSubMenu(HANDLE hMenu, int nPos); 714 [DllImport("user32")] public static extern int GetSysColor(int nIndex); 715 [DllImport("user32")] public static extern int GetSysColorBrush(int nIndex); 716 [DllImport("user32")] public static extern int GetSystemMenu(HWND hwnd, int bRevert); 717 [DllImport("user32")] public static extern int GetSystemMetrics(int nIndex); 718 [DllImport("user32")] public static extern int GetTabbedTextExtent(HDC hdc, string lpString, int nCount, int nTabPositions, ref int lpnTabStopPositions); 719 [DllImport("user32")] public static extern int GetThreadDesktop(int dwThread); 720 [DllImport("user32")] public static extern int GetTopWindow(HWND hwnd); 721 [DllImport("user32")] public static extern int GetUpdateRect(HWND hwnd, ref RECT lpRect, int bErase); 722 [DllImport("user32")] public static extern int GetUpdateRgn(HWND hwnd, HANDLE hRgn, int fErase); 723 [DllImport("user32")] public static extern int GetUserObjectInformation(HANDLE hObj, int nIndex, IntPtr pvInfo, int nLength, ref int lpnLengthNeeded); 724 [DllImport("user32")] public static extern int GetUserObjectSecurity(HANDLE hObj, ref int pSIRequested, ref SECURITY_DESCRIPTOR pSd, int nLength, ref int lpnLengthNeeded); 725 [DllImport("user32")] public static extern int GetWindow(HWND hwnd, int wCmd); 726 [DllImport("user32")] public static extern int GetWindowContextHelpId(HWND hwnd); 727 [DllImport("user32")] public static extern int GetWindowDC(HWND hwnd); 728 [DllImport("user32")] public static extern int GetWindowLong(HWND hwnd, int nIndex); 729 [DllImport("user32")] public static extern int GetWindowPlacement(HWND hwnd, ref WINDOWPLACEMENT lpwndpl); 730 [DllImport("user32")] public static extern int GetWindowRect(HWND hwnd, ref RECT lpRect); 731 [DllImport("user32")] public static extern int GetWindowRgn(HWND hwnd, HANDLE hRgn); 732 [DllImport("user32")] public static extern int GetWindowText(HWND hwnd, StringBuilder lpString, int cch); 733 [DllImport("user32")] public static extern int GetWindowTextLength(HWND hwnd); 734 [DllImport("user32")] public static extern int GetWindowThreadProcessId(HWND hwnd, ref int lpdwProcessId); 735 [DllImport("user32")] public static extern int GrayString(HWND hdc, HANDLE hBrush, ref int lpOutputFunc, ref int lpData, int nCount, int X, int Y, int nWidth, int nHeight); 736 [DllImport("user32")] public static extern int HideCaret(HWND hwnd); 737 [DllImport("user32")] public static extern int HiliteMenuItem(HWND hwnd, HANDLE hMenu, int wIDHiliteItem, int wHilite); 738 [DllImport("user32")] public static extern int ImpersonateDdeClientWindow(HWND hwndClient, HWND hwndServer); 739 [DllImport("user32")] public static extern int InSendMessage(); 740 [DllImport("user32")] public static extern int InflateRect(ref RECT lpRect, int x, int y); 741 [DllImport("user32")] public static extern int InsertMenu(HANDLE hMenu, int nPosition, int wFlags, int wIDNewItem, IntPtr lpNewItem); 742 [DllImport("user32")] public static extern int InsertMenuItem(HANDLE hMenu, int un, bool b, ref MENUITEMINFO lpcMenuItemInfo); 743 [DllImport("user32")] public static extern int IntersectRect(ref RECT lpDestRect, ref RECT lpSrc1Rect, ref RECT lpSrc2Rect); 744 [DllImport("user32")] public static extern int InvalidateRect(HWND hwnd, ref RECT lpRect, int bErase); 745 [DllImport("user32")] public static extern int InvalidateRgn(HWND hwnd, HANDLE hRgn, int bErase); 746 [DllImport("user32")] public static extern int InvertRect(HDC hdc, ref RECT lpRect); 747 [DllImport("user32")] public static extern int IsCharAlpha(Byte cChar); 748 [DllImport("user32")] public static extern int IsCharAlphaNumeric(Byte cChar); 749 [DllImport("user32")] public static extern int IsCharLower(Byte cChar); 750 [DllImport("user32")] public static extern int IsCharUpper(Byte cChar); 751 [DllImport("user32")] public static extern int IsChild(HWND hwndParent, HWND hwnd); 752 [DllImport("user32")] public static extern int IsClipboardFormatAvailable(int wFormat); 753 [DllImport("user32")] public static extern int IsDialogMessage(HANDLE hDlg, ref MSG lpMsg); 754 [DllImport("user32")] public static extern int IsDlgButtonChecked(HANDLE hDlg, int nIDButton); 755 [DllImport("user32")] public static extern int IsIconic(HWND hwnd); 756 [DllImport("user32")] public static extern int IsMenu(HANDLE hMenu); 757 [DllImport("user32")] public static extern int IsRectEmpty(ref RECT lpRect); 758 [DllImport("user32")] public static extern int IsWindow(HWND hwnd); 759 [DllImport("user32")] public static extern int IsWindowEnabled(HWND hwnd); 760 [DllImport("user32")] public static extern int IsWindowUnicode(HWND hwnd); 761 [DllImport("user32")] public static extern int IsWindowVisible(HWND hwnd); 762 [DllImport("user32")] public static extern int IsZoomed(HWND hwnd); 763 [DllImport("user32")] public static extern int KillTimer(HWND hwnd, int nIDEvent); 764 [DllImport("user32")] public static extern int LoadAccelerators(HANDLE hInstance, string lpTableName); 765 [DllImport("user32")] public static extern int LoadBitmap(HANDLE hInstance, string lpBitmapName); 766 [DllImport("user32")] public static extern int LoadCursor(HANDLE hInstance, string lpCursorName); 767 [DllImport("user32")] public static extern int LoadCursorFromFile(string lpFileName); 768 [DllImport("user32")] public static extern int LoadIcon(HANDLE hInstance, string lpIconName); 769 [DllImport("user32")] public static extern int LoadImage(HANDLE hInst, string lpsz, int un1, int n1, int n2, int un2); 770 [DllImport("user32")] public static extern int LoadKeyboardLayout(string pwszKLID, int flags); 771 [DllImport("user32")] public static extern int LoadMenu(HANDLE hInstance, string lpString); 772 [DllImport("user32")] public static extern int LoadMenuIndirect(int lpMenuTemplate); 773 [DllImport("user32")] public static extern int LoadString(HANDLE hInstance, int wID, string lpBuffer, int nBufferMax); 774 [DllImport("user32")] public static extern int LockWindowUpdate(HWND hwndLock); 775 [DllImport("user32")] public static extern int LookupIconIdFromDirectory(Byte presbits, int fIcon); 776 [DllImport("user32")] public static extern int LookupIconIdFromDirectoryEx(Byte presbits, int fIcon, int cxDesired, int cyDesired, int Flags); 777 [DllImport("user32")] public static extern int MapDialogRect(HANDLE hDlg, ref RECT lpRect); 778 [DllImport("user32")] public static extern int MapVirtualKey(int wCode, int wMapType); 779 [DllImport("user32")] public static extern int MapVirtualKeyEx(int uCode, int uMapType, int dwhkl); 780 [DllImport("user32")] public static extern int MapWindowPoints(HWND hwndFrom, HWND hwndTo, POINT [] lppt, int cPoints); 781 [DllImport("user32")] public static extern int MenuItemFromPoint(HWND hwnd, HANDLE hMenu, POINT ptScreen); 782 [DllImport("user32")] public static extern int MessageBeep(int wType); 783 [DllImport("user32")] public static extern int MessageBox(HWND hwnd, string lpText, string lpCaption, int wType); 784 [DllImport("user32")] public static extern int MessageBoxEx(HWND hwnd, string lpText, string lpCaption, int uType, int wLanguageId); 785 [DllImport("user32")] public static extern int MessageBoxIndirect(ref MSGBOXPARAMS lpMsgBoxParams); 786 [DllImport("user32")] public static extern int ModifyMenu(HANDLE hMenu, int nPosition, int wFlags, int wIDNewItem, IntPtr lpString); 787 [DllImport("user32")] public static extern int MoveWindow(HWND hwnd, int x, int y, int nWidth, int nHeight, int bRepaint); 788 [DllImport("user32")] public static extern int MsgWaitForMultipleObjects(int nCount, ref int pHandles, int fWaitAll, int dwMilliseconds, int dwWakeMask); 789 [DllImport("user32")] public static extern int OemKeyScan(int wOemChar); 790 [DllImport("user32")] public static extern int OemToChar(string lpszSrc, string lpszDst); 791 [DllImport("user32")] public static extern int OemToCharBuff(string lpszSrc, string lpszDst, int cchDstLength); 792 [DllImport("user32")] public static extern int OffsetRect(ref RECT lpRect, int x, int y); 793 [DllImport("user32")] public static extern int OpenClipboard(HWND hwnd); 794 [DllImport("user32")] public static extern int OpenDesktop(string lpszDesktop, int dwFlags, int fInherit, int dwDesiredAccess); 795 [DllImport("user32")] public static extern int OpenIcon(HWND hwnd); 796 [DllImport("user32")] public static extern int OpenInputDesktop(int dwFlags, int fInherit, int dwDesiredAccess); 797 [DllImport("user32")] public static extern int OpenWindowStation(string lpszWinSta, int fInherit, int dwDesiredAccess); 798 [DllImport("user32")] public static extern int PackDDElParam(int msg, int uiLo, int uiHi); 799 [DllImport("user32")] public static extern int PaintDesktop(HDC hdc); 800 [DllImport("user32")] public static extern int PeekMessage(ref MSG lpMsg, HWND hwnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg); 801 [DllImport("user32")] public static extern int PostMessage(HWND hwnd, int wMsg, int wParam, int lParam); 802 [DllImport("user32")] public static extern int PostThreadMessage(int idThread, int msg, int wParam, int lParam); 803 [DllImport("user32")] public static extern int PtInRect(ref RECT lpRect, int ptX, int ptY); 804 [DllImport("user32")] public static extern int RedrawWindow(HWND hwnd, ref RECT lprcUpdate, HANDLE hrgnUpdate, int fuRedraw); 805 [DllImport("user32")] public static extern int RegisterClass(ref WNDCLASS Class); 806 [DllImport("user32")] public static extern int RegisterClipboardFormat(string lpString); 807 [DllImport("user32")] public static extern int RegisterHotKey(HWND hwnd, int id, int fsModifiers, int vk); 808 [DllImport("user32")] public static extern int RegisterWindowMessage(string lpString); 809 [DllImport("user32")] public static extern int ReleaseCapture(); 810 [DllImport("user32")] public static extern int ReleaseDC(HWND hwnd, HDC hdc); 811 [DllImport("user32")] public static extern int RemoveMenu(HANDLE hMenu, int nPosition, int wFlags); 812 [DllImport("user32")] public static extern int RemoveProp(HWND hwnd, string lpString); 813 [DllImport("user32")] public static extern int ReplyMessage(int lReply); 814 [DllImport("user32")] public static extern int ReuseDDElParam(int lParam, int msgIn, int msgOut, int uiLo, int uiHi); 815 [DllImport("user32")] public static extern int ScreenToClient(HWND hwnd, ref POINT lpPoint); 816 [DllImport("user32")] public static extern int ScrollDC(HDC hdc, int dx, int dy, ref RECT lprcScroll, ref RECT lprcClip, HANDLE hrgnUpdate, ref RECT lprcUpdate); 817 [DllImport("user32")] public static extern int ScrollWindow(HWND hwnd, int XAmount, int YAmount, ref RECT lpRect, ref RECT lpClipRect); 818 [DllImport("user32")] public static extern int ScrollWindowEx(HWND hwnd, int dx, int dy, ref RECT lprcScroll, ref RECT lprcClip, HANDLE hrgnUpdate, ref RECT lprcUpdate, int fuScroll); 819 [DllImport("user32")] public static extern int SendDlgItemMessage(HANDLE hDlg, int nIDDlgItem, int wMsg, int wParam, int lParam); 820 [DllImport("user32")] public static extern int SendMessage(HWND hwnd, int wMsg, int wParam, IntPtr lParam); 821 [DllImport("user32")] public static extern int SendMessageCallback(HWND hwnd, int msg, int wParam, int lParam, ref int lpResultCallBack, int dwData); 822 [DllImport("user32")] public static extern int SendMessageTimeout(HWND hwnd, int msg, int wParam, int lParam, int fuFlags, int uTimeout, ref int lpdwResult); 823 [DllImport("user32")] public static extern int SendNotifyMessage(HWND hwnd, int msg, int wParam, int lParam); 824 [DllImport("user32")] public static extern int SetActiveWindow(HWND hwnd); 825 [DllImport("user32")] public static extern int SetCapture(HWND hwnd); 826 [DllImport("user32")] public static extern int SetCaretBlinkTime(int wMSeconds); 827 [DllImport("user32")] public static extern int SetCaretPos(int x, int y); 828 [DllImport("user32")] public static extern int SetClassLong(HWND hwnd, int nIndex, int dwNewLong); 829 [DllImport("user32")] public static extern int SetClassWord(HWND hwnd, int nIndex, int wNewWord); 830 [DllImport("user32")] public static extern int SetClipboardData(int wFormat, HANDLE hMem); 831 [DllImport("user32")] public static extern int SetClipboardViewer(HWND hwnd); 832 [DllImport("user32")] public static extern int SetCursor(HANDLE hCursor); 833 [DllImport("user32")] public static extern int SetCursorPos(int x, int y); 834 [DllImport("user32")] public static extern int SetDlgItemInt(HANDLE hDlg, int nIDDlgItem, int wValue, int bSigned); 835 [DllImport("user32")] p