1 /* 2 * winternl.h 3 * 4 * Windows NT internal data structures and functions 5 * 6 * Note: This header exists only for compatibility with the native SDK. 7 * It's definitions are incomplete and potentially unsuitable. 8 * ReactOS modules should not make use of it! 9 * 10 * USE NDK INSTEAD! 11 * 12 * This file is part of the ReactOS PSDK package. 13 * 14 * Contributors: 15 * Timo Kreuzer (timo.kreuzer@reactos.org) 16 * 17 * THIS SOFTWARE IS NOT COPYRIGHTED 18 * 19 * This source code is offered for use in the public domain. You may 20 * use, modify or distribute it freely. 21 * 22 * This code is distributed in the hope that it will be useful but 23 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 24 * DISCLAIMED. This includes but is not limited to warranties of 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 26 * 27 */ 28 #pragma once 29 30 #ifdef __REACTOS__ 31 #error "Do not use this header, use NDK!" 32 #endif 33 34 #ifndef _WINTERNL_ 35 #define _WINTERNL_ 36 37 //#include <winapifamily.h> 38 #include <windef.h> 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 typedef _Return_type_success_(return >= 0) LONG NTSTATUS; 45 46 #ifndef NT_SUCCESS 47 #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) 48 #endif 49 50 #ifndef NT_INFORMATION 51 #define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1) 52 #endif 53 54 #ifndef NT_WARNING 55 #define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2) 56 #endif 57 58 #ifndef NT_ERROR 59 #define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3) 60 #endif 61 62 typedef CONST char *PCSZ; 63 64 typedef struct _STRING 65 { 66 USHORT Length; 67 USHORT MaximumLength; 68 PCHAR Buffer; 69 } STRING, *PSTRING; 70 typedef STRING ANSI_STRING; 71 typedef PSTRING PANSI_STRING; 72 typedef PSTRING PCANSI_STRING; // yes, thats the definition from MS! 73 typedef STRING OEM_STRING; 74 typedef PSTRING POEM_STRING; 75 typedef const STRING *PCOEM_STRING; 76 77 typedef struct _UNICODE_STRING 78 { 79 USHORT Length; 80 USHORT MaximumLength; 81 PWSTR Buffer; 82 } UNICODE_STRING, *PUNICODE_STRING; 83 typedef const UNICODE_STRING *PCUNICODE_STRING; 84 85 typedef struct _RTL_USER_PROCESS_PARAMETERS 86 { 87 BYTE Reserved1[16]; 88 PVOID Reserved2[10]; 89 UNICODE_STRING ImagePathName; 90 UNICODE_STRING CommandLine; 91 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; 92 93 typedef struct _PEB_LDR_DATA 94 { 95 BYTE Reserved1[8]; 96 PVOID Reserved2[3]; 97 LIST_ENTRY InMemoryOrderModuleList; 98 } PEB_LDR_DATA, *PPEB_LDR_DATA; 99 100 typedef struct _LDR_DATA_TABLE_ENTRY 101 { 102 PVOID Reserved1[2]; 103 LIST_ENTRY InMemoryOrderLinks; 104 PVOID Reserved2[2]; 105 PVOID DllBase; 106 PVOID Reserved3[2]; 107 UNICODE_STRING FullDllName; 108 BYTE Reserved4[8]; 109 PVOID Reserved5[3]; 110 union { 111 ULONG CheckSum; 112 PVOID Reserved6; 113 } DUMMYUNIONNAME; 114 ULONG TimeDateStamp; 115 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; 116 117 typedef 118 VOID 119 (NTAPI *PPS_POST_PROCESS_INIT_ROUTINE)( 120 VOID); 121 122 typedef struct _PEB 123 { 124 BYTE Reserved1[2]; 125 BYTE BeingDebugged; 126 BYTE Reserved2[1]; 127 PVOID Reserved3[2]; 128 PPEB_LDR_DATA Ldr; 129 PRTL_USER_PROCESS_PARAMETERS ProcessParameters; 130 PVOID Reserved4[3]; 131 PVOID AtlThunkSListPtr; 132 PVOID Reserved5; 133 ULONG Reserved6; 134 PVOID Reserved7; 135 ULONG Reserved8; 136 ULONG AtlThunkSListPtr32; 137 PVOID Reserved9[45]; 138 BYTE Reserved10[96]; 139 PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine; 140 BYTE Reserved11[128]; 141 PVOID Reserved12[1]; 142 ULONG SessionId; 143 } PEB, *PPEB; 144 145 typedef struct _TEB 146 { 147 PVOID Reserved1[12]; 148 PPEB ProcessEnvironmentBlock; 149 PVOID Reserved2[399]; 150 BYTE Reserved3[1952]; 151 PVOID TlsSlots[64]; 152 BYTE Reserved4[8]; 153 PVOID Reserved5[26]; 154 PVOID ReservedForOle; 155 PVOID Reserved6[4]; 156 PVOID TlsExpansionSlots; 157 } TEB, *PTEB; 158 159 typedef enum _FILE_INFORMATION_CLASS 160 { 161 FileDirectoryInformation = 1 162 } FILE_INFORMATION_CLASS; 163 164 #define INTERNAL_TS_ACTIVE_CONSOLE_ID (*((volatile ULONG*)0x7ffe02d8)) 165 #define LOGONID_CURRENT ((ULONG)-1) 166 #define SERVERNAME_CURRENT ((HANDLE)NULL) 167 168 /* Flags for NtCreateFile and NtOpenFile */ 169 #define FILE_DIRECTORY_FILE 0x00000001 170 #define FILE_WRITE_THROUGH 0x00000002 171 #define FILE_SEQUENTIAL_ONLY 0x00000004 172 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 173 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 174 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 175 #define FILE_NON_DIRECTORY_FILE 0x00000040 176 #define FILE_CREATE_TREE_CONNECTION 0x00000080 177 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100 178 #define FILE_NO_EA_KNOWLEDGE 0x00000200 179 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400 180 #define FILE_RANDOM_ACCESS 0x00000800 181 #define FILE_DELETE_ON_CLOSE 0x00001000 182 #define FILE_OPEN_BY_FILE_ID 0x00002000 183 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 184 #define FILE_NO_COMPRESSION 0x00008000 185 #if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) 186 #define FILE_OPEN_REQUIRING_OPLOCK 0x00010000 187 #endif 188 #define FILE_RESERVE_OPFILTER 0x00100000 189 #define FILE_OPEN_REPARSE_POINT 0x00200000 190 #define FILE_OPEN_NO_RECALL 0x00400000 191 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 192 193 /* Status for NtCreateFile or NtOpenFile */ 194 #define FILE_SUPERSEDED 0x00000000 195 #define FILE_OPENED 0x00000001 196 #define FILE_CREATED 0x00000002 197 #define FILE_OVERWRITTEN 0x00000003 198 #define FILE_EXISTS 0x00000004 199 #define FILE_DOES_NOT_EXIST 0x00000005 200 201 #define FILE_VALID_OPTION_FLAGS 0x00ffffff 202 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 203 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 204 #define FILE_VALID_SET_FLAGS 0x00000036 205 206 /* Disposition for NtCreateFile */ 207 #define FILE_SUPERSEDE 0x00000000 208 #define FILE_OPEN 0x00000001 209 #define FILE_CREATE 0x00000002 210 #define FILE_OPEN_IF 0x00000003 211 #define FILE_OVERWRITE 0x00000004 212 #define FILE_OVERWRITE_IF 0x00000005 213 #define FILE_MAXIMUM_DISPOSITION 0x00000005 214 215 typedef struct _OBJECT_ATTRIBUTES 216 { 217 ULONG Length; 218 HANDLE RootDirectory; 219 PUNICODE_STRING ObjectName; 220 ULONG Attributes; 221 PVOID SecurityDescriptor; 222 PVOID SecurityQualityOfService; 223 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; 224 225 #define OBJ_INHERIT 0x00000002L 226 #define OBJ_PERMANENT 0x00000010L 227 #define OBJ_EXCLUSIVE 0x00000020L 228 #define OBJ_CASE_INSENSITIVE 0x00000040L 229 #define OBJ_OPENIF 0x00000080L 230 #define OBJ_OPENLINK 0x00000100L 231 #define OBJ_KERNEL_HANDLE 0x00000200L 232 #define OBJ_FORCE_ACCESS_CHECK 0x00000400L 233 #define OBJ_VALID_ATTRIBUTES 0x000007F2L 234 235 #ifndef InitializeObjectAttributes 236 #define InitializeObjectAttributes(p, n, a, r, s) \ 237 { \ 238 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \ 239 (p)->RootDirectory = r; \ 240 (p)->Attributes = a; \ 241 (p)->ObjectName = n; \ 242 (p)->SecurityDescriptor = s; \ 243 (p)->SecurityQualityOfService = NULL; \ 244 } 245 #endif 246 247 typedef struct _IO_STATUS_BLOCK { 248 union { 249 NTSTATUS Status; 250 PVOID Pointer; 251 } DUMMYUNIONNAME; 252 253 ULONG_PTR Information; 254 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; 255 256 __kernel_entry 257 NTSYSCALLAPI 258 NTSTATUS 259 NTAPI 260 NtCreateFile( 261 _Out_ PHANDLE FileHandle, 262 _In_ ACCESS_MASK DesiredAccess, 263 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 264 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 265 _In_opt_ PLARGE_INTEGER AllocationSize, 266 _In_ ULONG FileAttributes, 267 _In_ ULONG ShareAccess, 268 _In_ ULONG CreateDisposition, 269 _In_ ULONG CreateOptions, 270 _In_reads_bytes_opt_(EaLength) PVOID EaBuffer, 271 _In_ ULONG EaLength); 272 273 __kernel_entry 274 NTSYSCALLAPI 275 NTSTATUS 276 NTAPI 277 NtOpenFile( 278 _Out_ PHANDLE FileHandle, 279 _In_ ACCESS_MASK DesiredAccess, 280 _In_ POBJECT_ATTRIBUTES ObjectAttributes, 281 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 282 _In_ ULONG ShareAccess, 283 _In_ ULONG OpenOptions); 284 285 __kernel_entry 286 NTSYSCALLAPI 287 NTSTATUS 288 NTAPI 289 NtClose( 290 _In_ HANDLE Handle); 291 292 typedef 293 VOID 294 (NTAPI *PIO_APC_ROUTINE)( 295 _In_ PVOID ApcContext, 296 _In_ PIO_STATUS_BLOCK IoStatusBlock, 297 _In_ ULONG Reserved); 298 299 __kernel_entry 300 NTSYSCALLAPI 301 NTSTATUS 302 NTAPI 303 NtDeviceIoControlFile( 304 _In_ HANDLE FileHandle, 305 _In_opt_ HANDLE Event, 306 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 307 _In_opt_ PVOID ApcContext, 308 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 309 _In_ ULONG IoControlCode, 310 _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, 311 _In_ ULONG InputBufferLength, 312 _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer, 313 _In_ ULONG OutputBufferLength); 314 315 __kernel_entry 316 NTSYSCALLAPI 317 NTSTATUS 318 NTAPI 319 NtWaitForSingleObject( 320 _In_ HANDLE Object, 321 _In_ BOOLEAN Alertable, 322 _In_opt_ PLARGE_INTEGER Timeout); 323 324 __kernel_entry 325 NTSYSCALLAPI 326 NTSTATUS 327 NTAPI 328 NtRenameKey( 329 _In_ HANDLE KeyHandle, 330 _In_ PUNICODE_STRING NewName); 331 332 __kernel_entry 333 NTSYSCALLAPI 334 NTSTATUS 335 NTAPI 336 NtNotifyChangeMultipleKeys( 337 _In_ HANDLE MasterKeyHandle, 338 _In_opt_ ULONG Count, 339 _In_reads_opt_(Count) OBJECT_ATTRIBUTES SubordinateObjects[], 340 _In_opt_ HANDLE Event, 341 _In_opt_ PIO_APC_ROUTINE ApcRoutine, 342 _In_opt_ PVOID ApcContext, 343 _Out_ PIO_STATUS_BLOCK IoStatusBlock, 344 _In_ ULONG CompletionFilter, 345 _In_ BOOLEAN WatchTree, 346 _Out_writes_bytes_opt_(BufferSize) PVOID Buffer, 347 _In_ ULONG BufferSize, 348 _In_ BOOLEAN Asynchronous); 349 350 typedef struct _KEY_VALUE_ENTRY 351 { 352 PUNICODE_STRING ValueName; 353 ULONG DataLength; 354 ULONG DataOffset; 355 ULONG Type; 356 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; 357 358 __kernel_entry 359 NTSYSCALLAPI 360 NTSTATUS 361 NTAPI 362 NtQueryMultipleValueKey( 363 _In_ HANDLE KeyHandle, 364 _Inout_updates_(EntryCount) PKEY_VALUE_ENTRY ValueEntries, 365 _In_ ULONG EntryCount, 366 _Out_writes_bytes_(*BufferLength) PVOID ValueBuffer, 367 _Inout_ PULONG BufferLength, 368 _Out_opt_ PULONG RequiredBufferLength); 369 370 typedef enum _KEY_SET_INFORMATION_CLASS 371 { 372 KeyWriteTimeInformation, 373 KeyWow64FlagsInformation, 374 KeyControlFlagsInformation, 375 KeySetVirtualizationInformation, 376 KeySetDebugInformation, 377 KeySetHandleTagsInformation, 378 MaxKeySetInfoClass 379 } KEY_SET_INFORMATION_CLASS; 380 381 __kernel_entry 382 NTSYSCALLAPI 383 NTSTATUS 384 NTAPI 385 NtSetInformationKey( 386 _In_ HANDLE KeyHandle, 387 _In_ _Strict_type_match_ 388 KEY_SET_INFORMATION_CLASS KeySetInformationClass, 389 _In_reads_bytes_(KeySetInformationLength) PVOID KeySetInformation, 390 _In_ ULONG KeySetInformationLength); 391 392 typedef enum _PROCESSINFOCLASS 393 { 394 ProcessBasicInformation = 0, 395 ProcessDebugPort = 7, 396 ProcessWow64Information = 26, 397 ProcessImageFileName = 27, 398 ProcessBreakOnTermination = 29 399 } PROCESSINFOCLASS; 400 401 typedef struct _PROCESS_BASIC_INFORMATION 402 { 403 PVOID Reserved1; 404 PPEB PebBaseAddress; 405 PVOID Reserved2[2]; 406 ULONG_PTR UniqueProcessId; 407 PVOID Reserved3; 408 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; 409 410 __kernel_entry 411 NTSYSCALLAPI 412 NTSTATUS 413 NTAPI 414 NtQueryInformationProcess( 415 _In_ HANDLE ProcessHandle, 416 _In_ PROCESSINFOCLASS ProcessInformationClass, 417 _Out_ PVOID ProcessInformation, 418 _In_ ULONG ProcessInformationLength, 419 _Out_opt_ PULONG ReturnLength); 420 421 typedef enum _THREADINFOCLASS 422 { 423 ThreadIsIoPending = 16 424 } THREADINFOCLASS; 425 426 __kernel_entry 427 NTSYSCALLAPI 428 NTSTATUS 429 NTAPI 430 NtQueryInformationThread( 431 _In_ HANDLE ThreadHandle, 432 _In_ THREADINFOCLASS ThreadInformationClass, 433 _Out_ PVOID ThreadInformation, 434 _In_ ULONG ThreadInformationLength, 435 _Out_opt_ PULONG ReturnLength); 436 437 typedef enum _OBJECT_INFORMATION_CLASS 438 { 439 ObjectBasicInformation = 0, 440 ObjectTypeInformation = 2 441 } OBJECT_INFORMATION_CLASS; 442 443 typedef struct _PUBLIC_OBJECT_BASIC_INFORMATION 444 { 445 ULONG Attributes; 446 ACCESS_MASK GrantedAccess; 447 ULONG HandleCount; 448 ULONG PointerCount; 449 ULONG Reserved[10]; 450 } PUBLIC_OBJECT_BASIC_INFORMATION, *PPUBLIC_OBJECT_BASIC_INFORMATION; 451 452 typedef struct __PUBLIC_OBJECT_TYPE_INFORMATION 453 { 454 UNICODE_STRING TypeName; 455 ULONG Reserved [22]; 456 } PUBLIC_OBJECT_TYPE_INFORMATION, *PPUBLIC_OBJECT_TYPE_INFORMATION; 457 458 _IRQL_requires_max_(PASSIVE_LEVEL) 459 __kernel_entry 460 NTSYSCALLAPI 461 NTSTATUS 462 NTAPI 463 NtQueryObject( 464 _In_opt_ HANDLE Handle, 465 _In_ OBJECT_INFORMATION_CLASS ObjectInformationClass, 466 _Out_writes_bytes_opt_(ObjectInformationLength) PVOID ObjectInformation, 467 _In_ ULONG ObjectInformationLength, 468 _Out_opt_ PULONG ReturnLength); 469 470 typedef enum _SYSTEM_INFORMATION_CLASS 471 { 472 SystemBasicInformation = 0, 473 SystemPerformanceInformation = 2, 474 SystemTimeOfDayInformation = 3, 475 SystemProcessInformation = 5, 476 SystemProcessorPerformanceInformation = 8, 477 SystemInterruptInformation = 23, 478 SystemExceptionInformation = 33, 479 SystemRegistryQuotaInformation = 37, 480 SystemLookasideInformation = 45, 481 SystemPolicyInformation = 134, 482 } SYSTEM_INFORMATION_CLASS; 483 484 typedef struct _SYSTEM_BASIC_INFORMATION 485 { 486 BYTE Reserved1[24]; 487 PVOID Reserved2[4]; 488 CCHAR NumberOfProcessors; 489 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION; 490 491 typedef struct _SYSTEM_PERFORMANCE_INFORMATION 492 { 493 #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) 494 BYTE Reserved1[344]; 495 #elif (_WIN32_WINNT >= _WIN32_WINNT_WIN7) 496 BYTE Reserved1[328]; 497 #else 498 BYTE Reserved1[312]; 499 #endif 500 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION; 501 502 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION 503 { 504 BYTE Reserved1[48]; 505 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; 506 507 typedef struct _SYSTEM_PROCESS_INFORMATION 508 { 509 ULONG NextEntryOffset; 510 BYTE Reserved1[52]; 511 PVOID Reserved2[3]; 512 HANDLE UniqueProcessId; 513 PVOID Reserved3; 514 ULONG HandleCount; 515 BYTE Reserved4[4]; 516 PVOID Reserved5[11]; 517 SIZE_T PeakPagefileUsage; 518 SIZE_T PrivatePageCount; 519 LARGE_INTEGER Reserved6[6]; 520 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; 521 522 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION 523 { 524 LARGE_INTEGER IdleTime; 525 LARGE_INTEGER KernelTime; 526 LARGE_INTEGER UserTime; 527 LARGE_INTEGER Reserved1[2]; 528 ULONG Reserved2; 529 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; 530 531 typedef struct _SYSTEM_INTERRUPT_INFORMATION 532 { 533 BYTE Reserved1[24]; 534 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION; 535 536 typedef struct _SYSTEM_EXCEPTION_INFORMATION 537 { 538 BYTE Reserved1[16]; 539 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION; 540 541 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION 542 { 543 ULONG RegistryQuotaAllowed; 544 ULONG RegistryQuotaUsed; 545 PVOID Reserved1; 546 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION; 547 548 typedef struct _SYSTEM_LOOKASIDE_INFORMATION 549 { 550 BYTE Reserved1[32]; 551 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION; 552 553 typedef struct _SYSTEM_POLICY_INFORMATION 554 { 555 PVOID Reserved1[2]; 556 ULONG Reserved2[3]; 557 } SYSTEM_POLICY_INFORMATION, *PSYSTEM_POLICY_INFORMATION; 558 559 __kernel_entry 560 NTSYSCALLAPI 561 NTSTATUS 562 NTAPI 563 NtQuerySystemInformation( 564 _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, 565 _Out_ PVOID SystemInformation, 566 _In_ ULONG InformationLength, 567 _Out_opt_ PULONG ResultLength); 568 569 typedef enum _WINSTATIONINFOCLASS 570 { 571 WinStationInformation = 8 572 } WINSTATIONINFOCLASS; 573 574 typedef struct _WINSTATIONINFORMATIONW 575 { 576 BYTE Reserved2[70]; 577 ULONG LogonId; 578 BYTE Reserved3[1140]; 579 } WINSTATIONINFORMATIONW, * PWINSTATIONINFORMATIONW; 580 581 typedef 582 BOOLEAN 583 (WINAPI * PWINSTATIONQUERYINFORMATIONW)( 584 HANDLE, 585 ULONG, 586 WINSTATIONINFOCLASS, 587 PVOID, 588 ULONG, 589 PULONG); 590 591 __kernel_entry 592 NTSYSCALLAPI 593 NTSTATUS 594 NTAPI 595 NtQuerySystemTime( 596 _Out_ PLARGE_INTEGER SystemTime); 597 598 #define RtlMoveMemory(Dest,Source,Length) memmove((Dest),(Source),(Length)) 599 #define RtlFillMemory(Dest,Length,Fill) memset((Dest),(Fill),(Length)) 600 #define RtlZeroMemory(Dest,Length) RtlFillMemory((Dest),(Length),0) 601 602 VOID 603 NTAPI 604 RtlInitString( 605 PSTRING DestinationString, 606 PCSZ SourceString); 607 608 VOID 609 NTAPI 610 RtlInitAnsiString( 611 PANSI_STRING DestinationString, 612 PCSZ SourceString); 613 614 VOID 615 NTAPI 616 RtlInitUnicodeString( 617 PUNICODE_STRING DestinationString, 618 PCWSTR SourceString); 619 620 VOID 621 NTAPI 622 RtlFreeAnsiString( 623 PANSI_STRING AnsiString); 624 625 VOID 626 NTAPI 627 RtlFreeOemString( 628 POEM_STRING OemString); 629 630 VOID 631 NTAPI 632 RtlFreeUnicodeString( 633 PUNICODE_STRING UnicodeString); 634 635 NTSTATUS 636 NTAPI 637 RtlAnsiStringToUnicodeString( 638 PUNICODE_STRING DestinationString, 639 PCANSI_STRING SourceString, 640 BOOLEAN AllocateDestinationString); 641 642 NTSTATUS 643 NTAPI 644 RtlUnicodeStringToAnsiString( 645 PANSI_STRING DestinationString, 646 PCUNICODE_STRING SourceString, 647 BOOLEAN AllocateDestinationString); 648 649 NTSTATUS 650 NTAPI 651 RtlUnicodeStringToOemString( 652 POEM_STRING DestinationString, 653 PCUNICODE_STRING SourceString, 654 BOOLEAN AllocateDestinationString); 655 656 NTSTATUS 657 NTAPI 658 RtlUnicodeToMultiByteSize( 659 _Out_ PULONG BytesInMultiByteString, 660 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString, 661 _In_ ULONG BytesInUnicodeString); 662 663 NTSTATUS 664 NTAPI 665 RtlCharToInteger( 666 PCSZ String, 667 ULONG Base, 668 PULONG Value); 669 670 BOOLEAN 671 NTAPI 672 RtlIsNameLegalDOS8Dot3( 673 _In_ PUNICODE_STRING Name, 674 _Inout_opt_ POEM_STRING OemName, 675 _Inout_opt_ PBOOLEAN NameContainsSpaces); 676 677 NTSTATUS 678 NTAPI 679 RtlLocalTimeToSystemTime( 680 IN PLARGE_INTEGER LocalTime, 681 _Out_ PLARGE_INTEGER SystemTime); 682 683 BOOLEAN 684 NTAPI 685 RtlTimeToSecondsSince1970( 686 PLARGE_INTEGER Time, 687 PULONG ElapsedSeconds); 688 689 _When_(Status < 0, _Out_range_(>, 0)) 690 _When_(Status >= 0, _Out_range_(==, 0)) 691 ULONG 692 NTAPI 693 RtlNtStatusToDosError( 694 _In_ NTSTATUS Status); 695 696 NTSTATUS 697 NTAPI 698 RtlConvertSidToUnicodeString( 699 PUNICODE_STRING UnicodeString, 700 PSID Sid, 701 BOOLEAN AllocateDestinationString); 702 703 ULONG 704 NTAPI 705 RtlUniform( 706 PULONG Seed); 707 708 709 #ifdef __cplusplus 710 } 711 #endif 712 713 #endif /* _WINTERNL_ */ 714