mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
Merge pull request #10003 from viriuwu/nt-thread-name
std.Thread.getName/setName: rework windows implementation
This commit is contained in:
commit
cf5009f9af
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
const std = @import("std.zig");
|
const std = @import("std.zig");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
const math = std.math;
|
||||||
const os = std.os;
|
const os = std.os;
|
||||||
const assert = std.debug.assert;
|
const assert = std.debug.assert;
|
||||||
const target = builtin.target;
|
const target = builtin.target;
|
||||||
@ -86,20 +87,28 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void {
|
|||||||
try file.writer().writeAll(name);
|
try file.writer().writeAll(name);
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
.windows => if (target.os.isAtLeast(.windows, .win10_rs1)) |res| {
|
.windows => {
|
||||||
// SetThreadDescription is only available since version 1607, which is 10.0.14393.795
|
var buf: [max_name_len]u16 = undefined;
|
||||||
// See https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
|
const len = try std.unicode.utf8ToUtf16Le(&buf, name);
|
||||||
if (!res) return error.Unsupported;
|
const byte_len = math.cast(c_ushort, len * 2) catch return error.NameTooLong;
|
||||||
|
|
||||||
var name_buf_w: [max_name_len:0]u16 = undefined;
|
// Note: NT allocates its own copy, no use-after-free here.
|
||||||
const length = try std.unicode.utf8ToUtf16Le(&name_buf_w, name);
|
const unicode_string = os.windows.UNICODE_STRING{
|
||||||
name_buf_w[length] = 0;
|
.Length = byte_len,
|
||||||
|
.MaximumLength = byte_len,
|
||||||
|
.Buffer = &buf,
|
||||||
|
};
|
||||||
|
|
||||||
try os.windows.SetThreadDescription(
|
switch (os.windows.ntdll.NtSetInformationThread(
|
||||||
self.getHandle(),
|
self.getHandle(),
|
||||||
@ptrCast(os.windows.LPWSTR, &name_buf_w),
|
.ThreadNameInformation,
|
||||||
);
|
&unicode_string,
|
||||||
return;
|
@sizeOf(os.windows.UNICODE_STRING),
|
||||||
|
)) {
|
||||||
|
.SUCCESS => return,
|
||||||
|
.NOT_IMPLEMENTED => return error.Unsupported,
|
||||||
|
else => |err| return os.windows.unexpectedStatus(err),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
.macos, .ios, .watchos, .tvos => if (use_pthreads) {
|
.macos, .ios, .watchos, .tvos => if (use_pthreads) {
|
||||||
// There doesn't seem to be a way to set the name for an arbitrary thread, only the current one.
|
// There doesn't seem to be a way to set the name for an arbitrary thread, only the current one.
|
||||||
@ -189,18 +198,25 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co
|
|||||||
// musl doesn't provide pthread_getname_np and there's no way to retrieve the thread id of an arbitrary thread.
|
// musl doesn't provide pthread_getname_np and there's no way to retrieve the thread id of an arbitrary thread.
|
||||||
return error.Unsupported;
|
return error.Unsupported;
|
||||||
},
|
},
|
||||||
.windows => if (target.os.isAtLeast(.windows, .win10_rs1)) |res| {
|
.windows => {
|
||||||
// GetThreadDescription is only available since version 1607, which is 10.0.14393.795
|
const buf_capacity = @sizeOf(os.windows.UNICODE_STRING) + (@sizeOf(u16) * max_name_len);
|
||||||
// See https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
|
var buf: [buf_capacity]u8 align(@alignOf(os.windows.UNICODE_STRING)) = undefined;
|
||||||
if (!res) return error.Unsupported;
|
|
||||||
|
|
||||||
var name_w: os.windows.LPWSTR = undefined;
|
switch (os.windows.ntdll.NtQueryInformationThread(
|
||||||
try os.windows.GetThreadDescription(self.getHandle(), &name_w);
|
self.getHandle(),
|
||||||
defer os.windows.LocalFree(name_w);
|
.ThreadNameInformation,
|
||||||
|
&buf,
|
||||||
const data_len = try std.unicode.utf16leToUtf8(buffer, std.mem.sliceTo(name_w, 0));
|
buf_capacity,
|
||||||
|
null,
|
||||||
return if (data_len >= 1) buffer[0..data_len] else null;
|
)) {
|
||||||
|
.SUCCESS => {
|
||||||
|
const string = @ptrCast(*const os.windows.UNICODE_STRING, &buf);
|
||||||
|
const len = try std.unicode.utf16leToUtf8(buffer, string.Buffer[0 .. string.Length / 2]);
|
||||||
|
return if (len > 0) buffer[0..len] else null;
|
||||||
|
},
|
||||||
|
.NOT_IMPLEMENTED => return error.Unsupported,
|
||||||
|
else => |err| return os.windows.unexpectedStatus(err),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
.macos, .ios, .watchos, .tvos => if (use_pthreads) {
|
.macos, .ios, .watchos, .tvos => if (use_pthreads) {
|
||||||
const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1);
|
const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1);
|
||||||
|
|||||||
@ -2042,21 +2042,6 @@ pub fn unexpectedStatus(status: NTSTATUS) std.os.UnexpectedError {
|
|||||||
return error.Unexpected;
|
return error.Unexpected;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn SetThreadDescription(hThread: HANDLE, lpThreadDescription: LPCWSTR) !void {
|
|
||||||
if (kernel32.SetThreadDescription(hThread, lpThreadDescription) == 0) {
|
|
||||||
switch (kernel32.GetLastError()) {
|
|
||||||
else => |err| return unexpectedError(err),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn GetThreadDescription(hThread: HANDLE, ppszThreadDescription: *LPWSTR) !void {
|
|
||||||
if (kernel32.GetThreadDescription(hThread, ppszThreadDescription) == 0) {
|
|
||||||
switch (kernel32.GetLastError()) {
|
|
||||||
else => |err| return unexpectedError(err),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const Win32Error = @import("windows/win32error.zig").Win32Error;
|
pub const Win32Error = @import("windows/win32error.zig").Win32Error;
|
||||||
pub const NTSTATUS = @import("windows/ntstatus.zig").NTSTATUS;
|
pub const NTSTATUS = @import("windows/ntstatus.zig").NTSTATUS;
|
||||||
pub const LANG = @import("windows/lang.zig");
|
pub const LANG = @import("windows/lang.zig");
|
||||||
|
|||||||
@ -402,6 +402,3 @@ pub extern "kernel32" fn SleepConditionVariableSRW(
|
|||||||
pub extern "kernel32" fn TryAcquireSRWLockExclusive(s: *SRWLOCK) callconv(WINAPI) BOOLEAN;
|
pub extern "kernel32" fn TryAcquireSRWLockExclusive(s: *SRWLOCK) callconv(WINAPI) BOOLEAN;
|
||||||
pub extern "kernel32" fn AcquireSRWLockExclusive(s: *SRWLOCK) callconv(WINAPI) void;
|
pub extern "kernel32" fn AcquireSRWLockExclusive(s: *SRWLOCK) callconv(WINAPI) void;
|
||||||
pub extern "kernel32" fn ReleaseSRWLockExclusive(s: *SRWLOCK) callconv(WINAPI) void;
|
pub extern "kernel32" fn ReleaseSRWLockExclusive(s: *SRWLOCK) callconv(WINAPI) void;
|
||||||
|
|
||||||
pub extern "kernel32" fn SetThreadDescription(hThread: HANDLE, lpThreadDescription: LPCWSTR) callconv(WINAPI) HRESULT;
|
|
||||||
pub extern "kernel32" fn GetThreadDescription(hThread: HANDLE, ppszThreadDescription: *LPWSTR) callconv(WINAPI) HRESULT;
|
|
||||||
|
|||||||
@ -23,23 +23,88 @@ const FILE_BASIC_INFORMATION = windows.FILE_BASIC_INFORMATION;
|
|||||||
const SIZE_T = windows.SIZE_T;
|
const SIZE_T = windows.SIZE_T;
|
||||||
const CURDIR = windows.CURDIR;
|
const CURDIR = windows.CURDIR;
|
||||||
|
|
||||||
pub extern "NtDll" fn RtlGetVersion(
|
pub const THREADINFOCLASS = enum(c_int) {
|
||||||
|
ThreadBasicInformation,
|
||||||
|
ThreadTimes,
|
||||||
|
ThreadPriority,
|
||||||
|
ThreadBasePriority,
|
||||||
|
ThreadAffinityMask,
|
||||||
|
ThreadImpersonationToken,
|
||||||
|
ThreadDescriptorTableEntry,
|
||||||
|
ThreadEnableAlignmentFaultFixup,
|
||||||
|
ThreadEventPair_Reusable,
|
||||||
|
ThreadQuerySetWin32StartAddress,
|
||||||
|
ThreadZeroTlsCell,
|
||||||
|
ThreadPerformanceCount,
|
||||||
|
ThreadAmILastThread,
|
||||||
|
ThreadIdealProcessor,
|
||||||
|
ThreadPriorityBoost,
|
||||||
|
ThreadSetTlsArrayAddress,
|
||||||
|
ThreadIsIoPending,
|
||||||
|
// Windows 2000+ from here
|
||||||
|
ThreadHideFromDebugger,
|
||||||
|
// Windows XP+ from here
|
||||||
|
ThreadBreakOnTermination,
|
||||||
|
ThreadSwitchLegacyState,
|
||||||
|
ThreadIsTerminated,
|
||||||
|
// Windows Vista+ from here
|
||||||
|
ThreadLastSystemCall,
|
||||||
|
ThreadIoPriority,
|
||||||
|
ThreadCycleTime,
|
||||||
|
ThreadPagePriority,
|
||||||
|
ThreadActualBasePriority,
|
||||||
|
ThreadTebInformation,
|
||||||
|
ThreadCSwitchMon,
|
||||||
|
// Windows 7+ from here
|
||||||
|
ThreadCSwitchPmu,
|
||||||
|
ThreadWow64Context,
|
||||||
|
ThreadGroupInformation,
|
||||||
|
ThreadUmsInformation,
|
||||||
|
ThreadCounterProfiling,
|
||||||
|
ThreadIdealProcessorEx,
|
||||||
|
// Windows 8+ from here
|
||||||
|
ThreadCpuAccountingInformation,
|
||||||
|
// Windows 8.1+ from here
|
||||||
|
ThreadSuspendCount,
|
||||||
|
// Windows 10+ from here
|
||||||
|
ThreadHeterogeneousCpuPolicy,
|
||||||
|
ThreadContainerId,
|
||||||
|
ThreadNameInformation,
|
||||||
|
ThreadSelectedCpuSets,
|
||||||
|
ThreadSystemThreadInformation,
|
||||||
|
ThreadActualGroupAffinity,
|
||||||
|
};
|
||||||
|
pub extern "ntdll" fn NtQueryInformationThread(
|
||||||
|
ThreadHandle: HANDLE,
|
||||||
|
ThreadInformationClass: THREADINFOCLASS,
|
||||||
|
ThreadInformation: *anyopaque,
|
||||||
|
ThreadInformationLength: ULONG,
|
||||||
|
ReturnLength: ?*ULONG,
|
||||||
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
pub extern "ntdll" fn NtSetInformationThread(
|
||||||
|
ThreadHandle: HANDLE,
|
||||||
|
ThreadInformationClass: THREADINFOCLASS,
|
||||||
|
ThreadInformation: *const anyopaque,
|
||||||
|
ThreadInformationLength: ULONG,
|
||||||
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
|
pub extern "ntdll" fn RtlGetVersion(
|
||||||
lpVersionInformation: *RTL_OSVERSIONINFOW,
|
lpVersionInformation: *RTL_OSVERSIONINFOW,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
pub extern "NtDll" fn RtlCaptureStackBackTrace(
|
pub extern "ntdll" fn RtlCaptureStackBackTrace(
|
||||||
FramesToSkip: DWORD,
|
FramesToSkip: DWORD,
|
||||||
FramesToCapture: DWORD,
|
FramesToCapture: DWORD,
|
||||||
BackTrace: **anyopaque,
|
BackTrace: **anyopaque,
|
||||||
BackTraceHash: ?*DWORD,
|
BackTraceHash: ?*DWORD,
|
||||||
) callconv(WINAPI) WORD;
|
) callconv(WINAPI) WORD;
|
||||||
pub extern "NtDll" fn NtQueryInformationFile(
|
pub extern "ntdll" fn NtQueryInformationFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
IoStatusBlock: *IO_STATUS_BLOCK,
|
IoStatusBlock: *IO_STATUS_BLOCK,
|
||||||
FileInformation: *anyopaque,
|
FileInformation: *anyopaque,
|
||||||
Length: ULONG,
|
Length: ULONG,
|
||||||
FileInformationClass: FILE_INFORMATION_CLASS,
|
FileInformationClass: FILE_INFORMATION_CLASS,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
pub extern "NtDll" fn NtSetInformationFile(
|
pub extern "ntdll" fn NtSetInformationFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
IoStatusBlock: *IO_STATUS_BLOCK,
|
IoStatusBlock: *IO_STATUS_BLOCK,
|
||||||
FileInformation: PVOID,
|
FileInformation: PVOID,
|
||||||
@ -47,12 +112,12 @@ pub extern "NtDll" fn NtSetInformationFile(
|
|||||||
FileInformationClass: FILE_INFORMATION_CLASS,
|
FileInformationClass: FILE_INFORMATION_CLASS,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtQueryAttributesFile(
|
pub extern "ntdll" fn NtQueryAttributesFile(
|
||||||
ObjectAttributes: *OBJECT_ATTRIBUTES,
|
ObjectAttributes: *OBJECT_ATTRIBUTES,
|
||||||
FileAttributes: *FILE_BASIC_INFORMATION,
|
FileAttributes: *FILE_BASIC_INFORMATION,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtCreateFile(
|
pub extern "ntdll" fn NtCreateFile(
|
||||||
FileHandle: *HANDLE,
|
FileHandle: *HANDLE,
|
||||||
DesiredAccess: ACCESS_MASK,
|
DesiredAccess: ACCESS_MASK,
|
||||||
ObjectAttributes: *OBJECT_ATTRIBUTES,
|
ObjectAttributes: *OBJECT_ATTRIBUTES,
|
||||||
@ -65,7 +130,7 @@ pub extern "NtDll" fn NtCreateFile(
|
|||||||
EaBuffer: ?*anyopaque,
|
EaBuffer: ?*anyopaque,
|
||||||
EaLength: ULONG,
|
EaLength: ULONG,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
pub extern "NtDll" fn NtDeviceIoControlFile(
|
pub extern "ntdll" fn NtDeviceIoControlFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
Event: ?HANDLE,
|
Event: ?HANDLE,
|
||||||
ApcRoutine: ?IO_APC_ROUTINE,
|
ApcRoutine: ?IO_APC_ROUTINE,
|
||||||
@ -77,7 +142,7 @@ pub extern "NtDll" fn NtDeviceIoControlFile(
|
|||||||
OutputBuffer: ?PVOID,
|
OutputBuffer: ?PVOID,
|
||||||
OutputBufferLength: ULONG,
|
OutputBufferLength: ULONG,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
pub extern "NtDll" fn NtFsControlFile(
|
pub extern "ntdll" fn NtFsControlFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
Event: ?HANDLE,
|
Event: ?HANDLE,
|
||||||
ApcRoutine: ?IO_APC_ROUTINE,
|
ApcRoutine: ?IO_APC_ROUTINE,
|
||||||
@ -89,16 +154,16 @@ pub extern "NtDll" fn NtFsControlFile(
|
|||||||
OutputBuffer: ?PVOID,
|
OutputBuffer: ?PVOID,
|
||||||
OutputBufferLength: ULONG,
|
OutputBufferLength: ULONG,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
pub extern "NtDll" fn NtClose(Handle: HANDLE) callconv(WINAPI) NTSTATUS;
|
pub extern "ntdll" fn NtClose(Handle: HANDLE) callconv(WINAPI) NTSTATUS;
|
||||||
pub extern "NtDll" fn RtlDosPathNameToNtPathName_U(
|
pub extern "ntdll" fn RtlDosPathNameToNtPathName_U(
|
||||||
DosPathName: [*:0]const u16,
|
DosPathName: [*:0]const u16,
|
||||||
NtPathName: *UNICODE_STRING,
|
NtPathName: *UNICODE_STRING,
|
||||||
NtFileNamePart: ?*?[*:0]const u16,
|
NtFileNamePart: ?*?[*:0]const u16,
|
||||||
DirectoryInfo: ?*CURDIR,
|
DirectoryInfo: ?*CURDIR,
|
||||||
) callconv(WINAPI) BOOL;
|
) callconv(WINAPI) BOOL;
|
||||||
pub extern "NtDll" fn RtlFreeUnicodeString(UnicodeString: *UNICODE_STRING) callconv(WINAPI) void;
|
pub extern "ntdll" fn RtlFreeUnicodeString(UnicodeString: *UNICODE_STRING) callconv(WINAPI) void;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtQueryDirectoryFile(
|
pub extern "ntdll" fn NtQueryDirectoryFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
Event: ?HANDLE,
|
Event: ?HANDLE,
|
||||||
ApcRoutine: ?IO_APC_ROUTINE,
|
ApcRoutine: ?IO_APC_ROUTINE,
|
||||||
@ -112,30 +177,30 @@ pub extern "NtDll" fn NtQueryDirectoryFile(
|
|||||||
RestartScan: BOOLEAN,
|
RestartScan: BOOLEAN,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtCreateKeyedEvent(
|
pub extern "ntdll" fn NtCreateKeyedEvent(
|
||||||
KeyedEventHandle: *HANDLE,
|
KeyedEventHandle: *HANDLE,
|
||||||
DesiredAccess: ACCESS_MASK,
|
DesiredAccess: ACCESS_MASK,
|
||||||
ObjectAttributes: ?PVOID,
|
ObjectAttributes: ?PVOID,
|
||||||
Flags: ULONG,
|
Flags: ULONG,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtReleaseKeyedEvent(
|
pub extern "ntdll" fn NtReleaseKeyedEvent(
|
||||||
EventHandle: ?HANDLE,
|
EventHandle: ?HANDLE,
|
||||||
Key: ?*const anyopaque,
|
Key: ?*const anyopaque,
|
||||||
Alertable: BOOLEAN,
|
Alertable: BOOLEAN,
|
||||||
Timeout: ?*const LARGE_INTEGER,
|
Timeout: ?*const LARGE_INTEGER,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtWaitForKeyedEvent(
|
pub extern "ntdll" fn NtWaitForKeyedEvent(
|
||||||
EventHandle: ?HANDLE,
|
EventHandle: ?HANDLE,
|
||||||
Key: ?*const anyopaque,
|
Key: ?*const anyopaque,
|
||||||
Alertable: BOOLEAN,
|
Alertable: BOOLEAN,
|
||||||
Timeout: ?*const LARGE_INTEGER,
|
Timeout: ?*const LARGE_INTEGER,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn RtlSetCurrentDirectory_U(PathName: *UNICODE_STRING) callconv(WINAPI) NTSTATUS;
|
pub extern "ntdll" fn RtlSetCurrentDirectory_U(PathName: *UNICODE_STRING) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtQueryObject(
|
pub extern "ntdll" fn NtQueryObject(
|
||||||
Handle: HANDLE,
|
Handle: HANDLE,
|
||||||
ObjectInformationClass: OBJECT_INFORMATION_CLASS,
|
ObjectInformationClass: OBJECT_INFORMATION_CLASS,
|
||||||
ObjectInformation: PVOID,
|
ObjectInformation: PVOID,
|
||||||
@ -143,22 +208,22 @@ pub extern "NtDll" fn NtQueryObject(
|
|||||||
ReturnLength: ?*ULONG,
|
ReturnLength: ?*ULONG,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn RtlWakeAddressAll(
|
pub extern "ntdll" fn RtlWakeAddressAll(
|
||||||
Address: ?*const anyopaque,
|
Address: ?*const anyopaque,
|
||||||
) callconv(WINAPI) void;
|
) callconv(WINAPI) void;
|
||||||
|
|
||||||
pub extern "NtDll" fn RtlWakeAddressSingle(
|
pub extern "ntdll" fn RtlWakeAddressSingle(
|
||||||
Address: ?*const anyopaque,
|
Address: ?*const anyopaque,
|
||||||
) callconv(WINAPI) void;
|
) callconv(WINAPI) void;
|
||||||
|
|
||||||
pub extern "NtDll" fn RtlWaitOnAddress(
|
pub extern "ntdll" fn RtlWaitOnAddress(
|
||||||
Address: ?*const anyopaque,
|
Address: ?*const anyopaque,
|
||||||
CompareAddress: ?*const anyopaque,
|
CompareAddress: ?*const anyopaque,
|
||||||
AddressSize: SIZE_T,
|
AddressSize: SIZE_T,
|
||||||
Timeout: ?*const LARGE_INTEGER,
|
Timeout: ?*const LARGE_INTEGER,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtLockFile(
|
pub extern "ntdll" fn NtLockFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
Event: ?HANDLE,
|
Event: ?HANDLE,
|
||||||
ApcRoutine: ?*IO_APC_ROUTINE,
|
ApcRoutine: ?*IO_APC_ROUTINE,
|
||||||
@ -171,7 +236,7 @@ pub extern "NtDll" fn NtLockFile(
|
|||||||
ExclusiveLock: BOOLEAN,
|
ExclusiveLock: BOOLEAN,
|
||||||
) callconv(WINAPI) NTSTATUS;
|
) callconv(WINAPI) NTSTATUS;
|
||||||
|
|
||||||
pub extern "NtDll" fn NtUnlockFile(
|
pub extern "ntdll" fn NtUnlockFile(
|
||||||
FileHandle: HANDLE,
|
FileHandle: HANDLE,
|
||||||
IoStatusBlock: *IO_STATUS_BLOCK,
|
IoStatusBlock: *IO_STATUS_BLOCK,
|
||||||
ByteOffset: *const LARGE_INTEGER,
|
ByteOffset: *const LARGE_INTEGER,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user