| author | |
| committer | |
| log | 8347791ce3e3ffc82d95c09ccc036e8e47c1ed0c |
| tree | ccd73698764a6d6b8f2b5884c2fea48667a8c356 |
| parent | 62de7a2efd760bec85a41d52eca641fd61cd4a5d |
| signature |
#1840
kernel32.AddVectoredExceptionHandler -> ntdll.RtlAddVectoredExceptionHandler
kernel32.RemoveVectoredExceptionHandler -> ntdll.RtlRemoveVectoredExceptionHandler
kernel32.ExitProcess -> ntdll.RtlExitUserProcess
kernel32.InitializeCriticalSection -> ntdll.RtlInitializeCriticalSection
kernel32.EnterCriticalSection -> ntdll.RtlEnterCriticalSection
kernel32.LeaveCriticalSection -> ntdll.RtlLeaveCriticalSection
kernel32.DeleteCriticalSection -> ntdll.RtlDeleteCriticalSection
kernel32.TryAcquireSRWLockExclusive -> ntdll.RtlTryAcquireSRWLockExclusive
kernel32.AcquireSRWLockExclusive -> ntdll.RtlAcquireSRWLockExclusive
kernel32.ReleaseSRWLockExclusive -> ntdll.RtlReleaseSRWLockExclusive
kernel32.WakeConditionVariable -> ntdll.RtlWakeConditionVariable
kernel32.WakeAllConditionVariable -> ntdll.RtlWakeAllConditionVariable
kernel32.HeapReAlloc -> ntdll.RtlReAllocateHeap
kernel32.HeapAlloc -> ntdll.RtlAllocateHeap7 files changed, 77 insertions(+), 99 deletions(-)
lib/std/Thread.zig+1-1| ... | @@ -674,7 +674,7 @@ const WindowsThreadImpl = struct { | ... | @@ -674,7 +674,7 @@ const WindowsThreadImpl = struct { |
| 674 | 674 | ||
| 675 | const heap_handle = windows.kernel32.GetProcessHeap() orelse return error.OutOfMemory; | 675 | const heap_handle = windows.kernel32.GetProcessHeap() orelse return error.OutOfMemory; |
| 676 | const alloc_bytes = @alignOf(Instance) + @sizeOf(Instance); | 676 | const alloc_bytes = @alignOf(Instance) + @sizeOf(Instance); |
| 677 | const alloc_ptr = windows.kernel32.HeapAlloc(heap_handle, 0, alloc_bytes) orelse return error.OutOfMemory; | 677 | const alloc_ptr = windows.ntdll.RtlAllocateHeap(heap_handle, 0, alloc_bytes) orelse return error.OutOfMemory; |
| 678 | errdefer assert(windows.kernel32.HeapFree(heap_handle, 0, alloc_ptr) != 0); | 678 | errdefer assert(windows.kernel32.HeapFree(heap_handle, 0, alloc_ptr) != 0); |
| 679 | 679 | ||
| 680 | const instance_bytes = @as([*]u8, @ptrCast(alloc_ptr))[0..alloc_bytes]; | 680 | const instance_bytes = @as([*]u8, @ptrCast(alloc_ptr))[0..alloc_bytes]; |
lib/std/Thread/Condition.zig+2-2| ... | @@ -180,8 +180,8 @@ const WindowsImpl = struct { | ... | @@ -180,8 +180,8 @@ const WindowsImpl = struct { |
| 180 | 180 | ||
| 181 | fn wake(self: *Impl, comptime notify: Notify) void { | 181 | fn wake(self: *Impl, comptime notify: Notify) void { |
| 182 | switch (notify) { | 182 | switch (notify) { |
| 183 | .one => os.windows.kernel32.WakeConditionVariable(&self.condition), | 183 | .one => os.windows.ntdll.RtlWakeConditionVariable(&self.condition), |
| 184 | .all => os.windows.kernel32.WakeAllConditionVariable(&self.condition), | 184 | .all => os.windows.ntdll.RtlWakeAllConditionVariable(&self.condition), |
| 185 | } | 185 | } |
| 186 | } | 186 | } |
| 187 | }; | 187 | }; |
lib/std/Thread/Mutex.zig+3-3| ... | @@ -109,15 +109,15 @@ const WindowsImpl = struct { | ... | @@ -109,15 +109,15 @@ const WindowsImpl = struct { |
| 109 | srwlock: windows.SRWLOCK = .{}, | 109 | srwlock: windows.SRWLOCK = .{}, |
| 110 | 110 | ||
| 111 | fn tryLock(self: *@This()) bool { | 111 | fn tryLock(self: *@This()) bool { |
| 112 | return windows.kernel32.TryAcquireSRWLockExclusive(&self.srwlock) != windows.FALSE; | 112 | return windows.ntdll.RtlTryAcquireSRWLockExclusive(&self.srwlock) != windows.FALSE; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | fn lock(self: *@This()) void { | 115 | fn lock(self: *@This()) void { |
| 116 | windows.kernel32.AcquireSRWLockExclusive(&self.srwlock); | 116 | windows.ntdll.RtlAcquireSRWLockExclusive(&self.srwlock); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | fn unlock(self: *@This()) void { | 119 | fn unlock(self: *@This()) void { |
| 120 | windows.kernel32.ReleaseSRWLockExclusive(&self.srwlock); | 120 | windows.ntdll.RtlReleaseSRWLockExclusive(&self.srwlock); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | const windows = std.os.windows; | 123 | const windows = std.os.windows; |
lib/std/debug.zig+2-2| ... | @@ -1433,7 +1433,7 @@ pub fn attachSegfaultHandler() void { | ... | @@ -1433,7 +1433,7 @@ pub fn attachSegfaultHandler() void { |
| 1433 | @compileError("segfault handler not supported for this target"); | 1433 | @compileError("segfault handler not supported for this target"); |
| 1434 | } | 1434 | } |
| 1435 | if (native_os == .windows) { | 1435 | if (native_os == .windows) { |
| 1436 | windows_segfault_handle = windows.kernel32.AddVectoredExceptionHandler(0, handleSegfaultWindows); | 1436 | windows_segfault_handle = windows.ntdll.RtlAddVectoredExceptionHandler(0, handleSegfaultWindows); |
| 1437 | return; | 1437 | return; |
| 1438 | } | 1438 | } |
| 1439 | const act = posix.Sigaction{ | 1439 | const act = posix.Sigaction{ |
| ... | @@ -1447,7 +1447,7 @@ pub fn attachSegfaultHandler() void { | ... | @@ -1447,7 +1447,7 @@ pub fn attachSegfaultHandler() void { |
| 1447 | fn resetSegfaultHandler() void { | 1447 | fn resetSegfaultHandler() void { |
| 1448 | if (native_os == .windows) { | 1448 | if (native_os == .windows) { |
| 1449 | if (windows_segfault_handle) |handle| { | 1449 | if (windows_segfault_handle) |handle| { |
| 1450 | assert(windows.kernel32.RemoveVectoredExceptionHandler(handle) != 0); | 1450 | assert(windows.ntdll.RtlRemoveVectoredExceptionHandler(handle) != 0); |
| 1451 | windows_segfault_handle = null; | 1451 | windows_segfault_handle = null; |
| 1452 | } | 1452 | } |
| 1453 | return; | 1453 | return; |
lib/std/os/windows/kernel32.zig+13-89| ... | @@ -2,17 +2,14 @@ const std = @import("../../std.zig"); | ... | @@ -2,17 +2,14 @@ const std = @import("../../std.zig"); |
| 2 | const windows = std.os.windows; | 2 | const windows = std.os.windows; |
| 3 | 3 | ||
| 4 | const BOOL = windows.BOOL; | 4 | const BOOL = windows.BOOL; |
| 5 | const BOOLEAN = windows.BOOLEAN; | ||
| 6 | const CONDITION_VARIABLE = windows.CONDITION_VARIABLE; | 5 | const CONDITION_VARIABLE = windows.CONDITION_VARIABLE; |
| 7 | const CONSOLE_SCREEN_BUFFER_INFO = windows.CONSOLE_SCREEN_BUFFER_INFO; | 6 | const CONSOLE_SCREEN_BUFFER_INFO = windows.CONSOLE_SCREEN_BUFFER_INFO; |
| 8 | const COORD = windows.COORD; | 7 | const COORD = windows.COORD; |
| 9 | const CRITICAL_SECTION = windows.CRITICAL_SECTION; | ||
| 10 | const DWORD = windows.DWORD; | 8 | const DWORD = windows.DWORD; |
| 11 | const FARPROC = windows.FARPROC; | 9 | const FARPROC = windows.FARPROC; |
| 12 | const FILETIME = windows.FILETIME; | 10 | const FILETIME = windows.FILETIME; |
| 13 | const HANDLE = windows.HANDLE; | 11 | const HANDLE = windows.HANDLE; |
| 14 | const HANDLER_ROUTINE = windows.HANDLER_ROUTINE; | 12 | const HANDLER_ROUTINE = windows.HANDLER_ROUTINE; |
| 15 | const HLOCAL = windows.HLOCAL; | ||
| 16 | const HMODULE = windows.HMODULE; | 13 | const HMODULE = windows.HMODULE; |
| 17 | const INIT_ONCE = windows.INIT_ONCE; | 14 | const INIT_ONCE = windows.INIT_ONCE; |
| 18 | const INIT_ONCE_FN = windows.INIT_ONCE_FN; | 15 | const INIT_ONCE_FN = windows.INIT_ONCE_FN; |
| ... | @@ -32,30 +29,29 @@ const SECURITY_ATTRIBUTES = windows.SECURITY_ATTRIBUTES; | ... | @@ -32,30 +29,29 @@ const SECURITY_ATTRIBUTES = windows.SECURITY_ATTRIBUTES; |
| 32 | const SIZE_T = windows.SIZE_T; | 29 | const SIZE_T = windows.SIZE_T; |
| 33 | const SRWLOCK = windows.SRWLOCK; | 30 | const SRWLOCK = windows.SRWLOCK; |
| 34 | const STARTUPINFOW = windows.STARTUPINFOW; | 31 | const STARTUPINFOW = windows.STARTUPINFOW; |
| 32 | const SYSTEM_INFO = windows.SYSTEM_INFO; | ||
| 35 | const UCHAR = windows.UCHAR; | 33 | const UCHAR = windows.UCHAR; |
| 36 | const UINT = windows.UINT; | 34 | const UINT = windows.UINT; |
| 37 | const ULONG = windows.ULONG; | 35 | const ULONG = windows.ULONG; |
| 38 | const ULONG_PTR = windows.ULONG_PTR; | 36 | const ULONG_PTR = windows.ULONG_PTR; |
| 39 | const va_list = windows.va_list; | 37 | const va_list = windows.va_list; |
| 40 | const VECTORED_EXCEPTION_HANDLER = windows.VECTORED_EXCEPTION_HANDLER; | ||
| 41 | const WCHAR = windows.WCHAR; | 38 | const WCHAR = windows.WCHAR; |
| 42 | const WIN32_FIND_DATAW = windows.WIN32_FIND_DATAW; | 39 | const WIN32_FIND_DATAW = windows.WIN32_FIND_DATAW; |
| 43 | const Win32Error = windows.Win32Error; | 40 | const Win32Error = windows.Win32Error; |
| 44 | const WORD = windows.WORD; | 41 | const WORD = windows.WORD; |
| 45 | const SYSTEM_INFO = windows.SYSTEM_INFO; | ||
| 46 | 42 | ||
| 47 | // I/O - Filesystem | 43 | // I/O - Filesystem |
| 48 | 44 | ||
| 49 | pub extern "kernel32" fn ReadDirectoryChangesW( | 45 | pub extern "kernel32" fn ReadDirectoryChangesW( |
| 50 | hDirectory: windows.HANDLE, | 46 | hDirectory: HANDLE, |
| 51 | lpBuffer: [*]align(@alignOf(windows.FILE_NOTIFY_INFORMATION)) u8, | 47 | lpBuffer: [*]align(@alignOf(windows.FILE_NOTIFY_INFORMATION)) u8, |
| 52 | nBufferLength: windows.DWORD, | 48 | nBufferLength: DWORD, |
| 53 | bWatchSubtree: windows.BOOL, | 49 | bWatchSubtree: BOOL, |
| 54 | dwNotifyFilter: windows.FileNotifyChangeFilter, | 50 | dwNotifyFilter: windows.FileNotifyChangeFilter, |
| 55 | lpBytesReturned: ?*windows.DWORD, | 51 | lpBytesReturned: ?*DWORD, |
| 56 | lpOverlapped: ?*windows.OVERLAPPED, | 52 | lpOverlapped: ?*OVERLAPPED, |
| 57 | lpCompletionRoutine: windows.LPOVERLAPPED_COMPLETION_ROUTINE, | 53 | lpCompletionRoutine: windows.LPOVERLAPPED_COMPLETION_ROUTINE, |
| 58 | ) callconv(.winapi) windows.BOOL; | 54 | ) callconv(.winapi) BOOL; |
| 59 | 55 | ||
| 60 | // TODO: Wrapper around NtCancelIoFile. | 56 | // TODO: Wrapper around NtCancelIoFile. |
| 61 | pub extern "kernel32" fn CancelIo( | 57 | pub extern "kernel32" fn CancelIo( |
| ... | @@ -258,17 +254,6 @@ pub extern "kernel32" fn CreateIoCompletionPort( | ... | @@ -258,17 +254,6 @@ pub extern "kernel32" fn CreateIoCompletionPort( |
| 258 | NumberOfConcurrentThreads: DWORD, | 254 | NumberOfConcurrentThreads: DWORD, |
| 259 | ) callconv(.winapi) ?HANDLE; | 255 | ) callconv(.winapi) ?HANDLE; |
| 260 | 256 | ||
| 261 | // TODO: Forwarder to NtAddVectoredExceptionHandler. | ||
| 262 | pub extern "kernel32" fn AddVectoredExceptionHandler( | ||
| 263 | First: ULONG, | ||
| 264 | Handler: ?VECTORED_EXCEPTION_HANDLER, | ||
| 265 | ) callconv(.winapi) ?LPVOID; | ||
| 266 | |||
| 267 | // TODO: Forwarder to NtRemoveVectoredExceptionHandler. | ||
| 268 | pub extern "kernel32" fn RemoveVectoredExceptionHandler( | ||
| 269 | Handle: HANDLE, | ||
| 270 | ) callconv(.winapi) ULONG; | ||
| 271 | |||
| 272 | // TODO: Wrapper around RtlReportSilentProcessExit + NtTerminateProcess. | 257 | // TODO: Wrapper around RtlReportSilentProcessExit + NtTerminateProcess. |
| 273 | pub extern "kernel32" fn TerminateProcess( | 258 | pub extern "kernel32" fn TerminateProcess( |
| 274 | hProcess: HANDLE, | 259 | hProcess: HANDLE, |
| ... | @@ -321,11 +306,6 @@ pub extern "kernel32" fn CreateProcessW( | ... | @@ -321,11 +306,6 @@ pub extern "kernel32" fn CreateProcessW( |
| 321 | lpProcessInformation: *PROCESS_INFORMATION, | 306 | lpProcessInformation: *PROCESS_INFORMATION, |
| 322 | ) callconv(.winapi) BOOL; | 307 | ) callconv(.winapi) BOOL; |
| 323 | 308 | ||
| 324 | // TODO: Fowarder to RtlExitUserProcess. | ||
| 325 | pub extern "kernel32" fn ExitProcess( | ||
| 326 | exit_code: UINT, | ||
| 327 | ) callconv(.winapi) noreturn; | ||
| 328 | |||
| 329 | // TODO: implement via ntdll instead | 309 | // TODO: implement via ntdll instead |
| 330 | pub extern "kernel32" fn SleepEx( | 310 | pub extern "kernel32" fn SleepEx( |
| 331 | dwMilliseconds: DWORD, | 311 | dwMilliseconds: DWORD, |
| ... | @@ -372,41 +352,6 @@ pub extern "kernel32" fn SwitchToThread() callconv(.winapi) BOOL; | ... | @@ -372,41 +352,6 @@ pub extern "kernel32" fn SwitchToThread() callconv(.winapi) BOOL; |
| 372 | 352 | ||
| 373 | // Locks, critical sections, initializers | 353 | // Locks, critical sections, initializers |
| 374 | 354 | ||
| 375 | // TODO: Forwarder to RtlInitializeCriticalSection | ||
| 376 | pub extern "kernel32" fn InitializeCriticalSection( | ||
| 377 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 378 | ) callconv(.winapi) void; | ||
| 379 | |||
| 380 | // TODO: Forwarder to RtlEnterCriticalSection | ||
| 381 | pub extern "kernel32" fn EnterCriticalSection( | ||
| 382 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 383 | ) callconv(.winapi) void; | ||
| 384 | |||
| 385 | // TODO: Forwarder to RtlLeaveCriticalSection | ||
| 386 | pub extern "kernel32" fn LeaveCriticalSection( | ||
| 387 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 388 | ) callconv(.winapi) void; | ||
| 389 | |||
| 390 | // TODO: Forwarder to RtlDeleteCriticalSection | ||
| 391 | pub extern "kernel32" fn DeleteCriticalSection( | ||
| 392 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 393 | ) callconv(.winapi) void; | ||
| 394 | |||
| 395 | // TODO: Forwarder to RtlTryAcquireSRWLockExclusive | ||
| 396 | pub extern "kernel32" fn TryAcquireSRWLockExclusive( | ||
| 397 | SRWLock: *SRWLOCK, | ||
| 398 | ) callconv(.winapi) BOOLEAN; | ||
| 399 | |||
| 400 | // TODO: Forwarder to RtlAcquireSRWLockExclusive | ||
| 401 | pub extern "kernel32" fn AcquireSRWLockExclusive( | ||
| 402 | SRWLock: *SRWLOCK, | ||
| 403 | ) callconv(.winapi) void; | ||
| 404 | |||
| 405 | // TODO: Forwarder to RtlReleaseSRWLockExclusive | ||
| 406 | pub extern "kernel32" fn ReleaseSRWLockExclusive( | ||
| 407 | SRWLock: *SRWLOCK, | ||
| 408 | ) callconv(.winapi) void; | ||
| 409 | |||
| 410 | pub extern "kernel32" fn InitOnceExecuteOnce( | 355 | pub extern "kernel32" fn InitOnceExecuteOnce( |
| 411 | InitOnce: *INIT_ONCE, | 356 | InitOnce: *INIT_ONCE, |
| 412 | InitFn: INIT_ONCE_FN, | 357 | InitFn: INIT_ONCE_FN, |
| ... | @@ -414,16 +359,6 @@ pub extern "kernel32" fn InitOnceExecuteOnce( | ... | @@ -414,16 +359,6 @@ pub extern "kernel32" fn InitOnceExecuteOnce( |
| 414 | Context: ?*anyopaque, | 359 | Context: ?*anyopaque, |
| 415 | ) callconv(.winapi) BOOL; | 360 | ) callconv(.winapi) BOOL; |
| 416 | 361 | ||
| 417 | // TODO: Forwarder to RtlWakeConditionVariable | ||
| 418 | pub extern "kernel32" fn WakeConditionVariable( | ||
| 419 | ConditionVariable: *CONDITION_VARIABLE, | ||
| 420 | ) callconv(.winapi) void; | ||
| 421 | |||
| 422 | // TODO: Forwarder to RtlWakeAllConditionVariable | ||
| 423 | pub extern "kernel32" fn WakeAllConditionVariable( | ||
| 424 | ConditionVariable: *CONDITION_VARIABLE, | ||
| 425 | ) callconv(.winapi) void; | ||
| 426 | |||
| 427 | // TODO: | 362 | // TODO: |
| 428 | // - dwMilliseconds -> LARGE_INTEGER. | 363 | // - dwMilliseconds -> LARGE_INTEGER. |
| 429 | // - RtlSleepConditionVariableSRW | 364 | // - RtlSleepConditionVariableSRW |
| ... | @@ -514,22 +449,9 @@ pub extern "kernel32" fn HeapCreate( | ... | @@ -514,22 +449,9 @@ pub extern "kernel32" fn HeapCreate( |
| 514 | dwMaximumSize: SIZE_T, | 449 | dwMaximumSize: SIZE_T, |
| 515 | ) callconv(.winapi) ?HANDLE; | 450 | ) callconv(.winapi) ?HANDLE; |
| 516 | 451 | ||
| 517 | // TODO: Forwarder to RtlReAllocateHeap. | 452 | // TODO: Fowrarder to RtlFreeHeap before win11_zn. |
| 518 | pub extern "kernel32" fn HeapReAlloc( | 453 | // Since win11_zn this function points to unexported symbol RtlFreeHeapFast. |
| 519 | hHeap: HANDLE, | 454 | // See https://github.com/ziglang/zig/pull/25766#discussion_r2479727640 |
| 520 | dwFlags: DWORD, | ||
| 521 | lpMem: *anyopaque, | ||
| 522 | dwBytes: SIZE_T, | ||
| 523 | ) callconv(.winapi) ?*anyopaque; | ||
| 524 | |||
| 525 | // TODO: Fowrarder to RtlAllocateHeap. | ||
| 526 | pub extern "kernel32" fn HeapAlloc( | ||
| 527 | hHeap: HANDLE, | ||
| 528 | dwFlags: DWORD, | ||
| 529 | dwBytes: SIZE_T, | ||
| 530 | ) callconv(.winapi) ?*anyopaque; | ||
| 531 | |||
| 532 | // TODO: Fowrarder to RtlFreeHeap. | ||
| 533 | pub extern "kernel32" fn HeapFree( | 455 | pub extern "kernel32" fn HeapFree( |
| 534 | hHeap: HANDLE, | 456 | hHeap: HANDLE, |
| 535 | dwFlags: DWORD, | 457 | dwFlags: DWORD, |
| ... | @@ -642,4 +564,6 @@ pub extern "kernel32" fn SetLastError( | ... | @@ -642,4 +564,6 @@ pub extern "kernel32" fn SetLastError( |
| 642 | 564 | ||
| 643 | // Everything Else | 565 | // Everything Else |
| 644 | 566 | ||
| 645 | pub extern "kernel32" fn GetSystemInfo(lpSystemInfo: *SYSTEM_INFO) callconv(.winapi) void; | 567 | pub extern "kernel32" fn GetSystemInfo( |
| 568 | lpSystemInfo: *SYSTEM_INFO, | ||
| 569 | ) callconv(.winapi) void; |
lib/std/os/windows/ntdll.zig+54| ... | @@ -37,6 +37,10 @@ const PROCESSINFOCLASS = windows.PROCESSINFOCLASS; | ... | @@ -37,6 +37,10 @@ const PROCESSINFOCLASS = windows.PROCESSINFOCLASS; |
| 37 | const LPVOID = windows.LPVOID; | 37 | const LPVOID = windows.LPVOID; |
| 38 | const LPCVOID = windows.LPCVOID; | 38 | const LPCVOID = windows.LPCVOID; |
| 39 | const SECTION_INHERIT = windows.SECTION_INHERIT; | 39 | const SECTION_INHERIT = windows.SECTION_INHERIT; |
| 40 | const VECTORED_EXCEPTION_HANDLER = windows.VECTORED_EXCEPTION_HANDLER; | ||
| 41 | const CRITICAL_SECTION = windows.CRITICAL_SECTION; | ||
| 42 | const SRWLOCK = windows.SRWLOCK; | ||
| 43 | const CONDITION_VARIABLE = windows.CONDITION_VARIABLE; | ||
| 40 | 44 | ||
| 41 | pub extern "ntdll" fn NtQueryInformationProcess( | 45 | pub extern "ntdll" fn NtQueryInformationProcess( |
| 42 | ProcessHandle: HANDLE, | 46 | ProcessHandle: HANDLE, |
| ... | @@ -375,3 +379,53 @@ pub extern "ntdll" fn NtFreeVirtualMemory( | ... | @@ -375,3 +379,53 @@ pub extern "ntdll" fn NtFreeVirtualMemory( |
| 375 | RegionSize: *SIZE_T, | 379 | RegionSize: *SIZE_T, |
| 376 | FreeType: ULONG, | 380 | FreeType: ULONG, |
| 377 | ) callconv(.winapi) NTSTATUS; | 381 | ) callconv(.winapi) NTSTATUS; |
| 382 | |||
| 383 | pub extern "ntdll" fn RtlAddVectoredExceptionHandler( | ||
| 384 | First: ULONG, | ||
| 385 | Handler: ?VECTORED_EXCEPTION_HANDLER, | ||
| 386 | ) callconv(.winapi) ?LPVOID; | ||
| 387 | pub extern "ntdll" fn RtlRemoveVectoredExceptionHandler( | ||
| 388 | Handle: HANDLE, | ||
| 389 | ) callconv(.winapi) ULONG; | ||
| 390 | |||
| 391 | pub extern "ntdll" fn RtlInitializeCriticalSection( | ||
| 392 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 393 | ) callconv(.winapi) NTSTATUS; | ||
| 394 | pub extern "ntdll" fn RtlEnterCriticalSection( | ||
| 395 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 396 | ) callconv(.winapi) NTSTATUS; | ||
| 397 | pub extern "ntdll" fn RtlLeaveCriticalSection( | ||
| 398 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 399 | ) callconv(.winapi) NTSTATUS; | ||
| 400 | pub extern "ntdll" fn RtlDeleteCriticalSection( | ||
| 401 | lpCriticalSection: *CRITICAL_SECTION, | ||
| 402 | ) callconv(.winapi) NTSTATUS; | ||
| 403 | |||
| 404 | pub extern "ntdll" fn RtlTryAcquireSRWLockExclusive( | ||
| 405 | SRWLock: *SRWLOCK, | ||
| 406 | ) callconv(.winapi) BOOLEAN; | ||
| 407 | pub extern "ntdll" fn RtlAcquireSRWLockExclusive( | ||
| 408 | SRWLock: *SRWLOCK, | ||
| 409 | ) callconv(.winapi) void; | ||
| 410 | pub extern "ntdll" fn RtlReleaseSRWLockExclusive( | ||
| 411 | SRWLock: *SRWLOCK, | ||
| 412 | ) callconv(.winapi) void; | ||
| 413 | |||
| 414 | pub extern "ntdll" fn RtlWakeConditionVariable( | ||
| 415 | ConditionVariable: *CONDITION_VARIABLE, | ||
| 416 | ) callconv(.winapi) void; | ||
| 417 | pub extern "ntdll" fn RtlWakeAllConditionVariable( | ||
| 418 | ConditionVariable: *CONDITION_VARIABLE, | ||
| 419 | ) callconv(.winapi) void; | ||
| 420 | |||
| 421 | pub extern "ntdll" fn RtlReAllocateHeap( | ||
| 422 | HeapHandle: HANDLE, | ||
| 423 | Flags: ULONG, | ||
| 424 | BaseAddress: PVOID, | ||
| 425 | Size: SIZE_T, | ||
| 426 | ) callconv(.winapi) ?PVOID; | ||
| 427 | pub extern "ntdll" fn RtlAllocateHeap( | ||
| 428 | HeapHandle: HANDLE, | ||
| 429 | Flags: ULONG, | ||
| 430 | Size: SIZE_T, | ||
| 431 | ) callconv(.winapi) ?PVOID; |
lib/std/posix.zig+2-2| ... | @@ -701,7 +701,7 @@ pub fn abort() noreturn { | ... | @@ -701,7 +701,7 @@ pub fn abort() noreturn { |
| 701 | if (builtin.mode == .Debug and windows.peb().BeingDebugged != 0) { | 701 | if (builtin.mode == .Debug and windows.peb().BeingDebugged != 0) { |
| 702 | @breakpoint(); | 702 | @breakpoint(); |
| 703 | } | 703 | } |
| 704 | windows.kernel32.ExitProcess(3); | 704 | windows.ntdll.RtlExitUserProcess(3); |
| 705 | } | 705 | } |
| 706 | if (!builtin.link_libc and native_os == .linux) { | 706 | if (!builtin.link_libc and native_os == .linux) { |
| 707 | // The Linux man page says that the libc abort() function | 707 | // The Linux man page says that the libc abort() function |
| ... | @@ -794,7 +794,7 @@ pub fn exit(status: u8) noreturn { | ... | @@ -794,7 +794,7 @@ pub fn exit(status: u8) noreturn { |
| 794 | std.c.exit(status); | 794 | std.c.exit(status); |
| 795 | } | 795 | } |
| 796 | if (native_os == .windows) { | 796 | if (native_os == .windows) { |
| 797 | windows.kernel32.ExitProcess(status); | 797 | windows.ntdll.RtlExitUserProcess(status); |
| 798 | } | 798 | } |
| 799 | if (native_os == .wasi) { | 799 | if (native_os == .wasi) { |
| 800 | wasi.proc_exit(status); | 800 | wasi.proc_exit(status); |