redo boot around an explicit system volume and fixed kernel/HAL images, redo volumes and filesystem paths around capabilities instead of drive numbers and kernel CWD state, add a capability/security model with derived and revocable handles and security contexts, add port IPC and rssrv to manage the userspace resource namespace and publish the system volume, move process, dll and path loading to userspace and add process builder syscalls, init now supervises rssrv and the session process, redo the syscall ABI around request structs and four arguments, add a volume manager and proper partition arrival/removal handling so FAT and NTFS mount dynamically, clean up the HAL/DDK boundary so drivers don't depend on HAL internals, save fpu state properly now, the serial driver doesn't hang on a missing port, fix AHCI startup races, fix timeout accounting, fix shared mmap writeback, more smoke tests
This commit is contained in:
1 parent
4add6789ba
commit
f882d339fb
232 files changed
+20934
-8898
No files matched your search
@@ -5,21 +5,21 @@
|
||||
#include <stdint.h>
|
||||
#include <ntlite/status.h>
|
||||
|
||||
#define KE_DEBUG_CONSOLE 0x00000001u
|
||||
#define KE_DEBUG_SELFTEST 0x00000002u
|
||||
#define KE_DEBUG_FILE_LOG 0x00000004u
|
||||
#define KE_DEBUG_POOL_CANARY 0x00000008u
|
||||
#define KE_DEBUG_POOL_POISON 0x00000010u
|
||||
#define KE_DEBUG_POOL_QUARANTINE 0x00000020u
|
||||
#define KE_DEBUG_POOL_CALLERS 0x00000040u
|
||||
#define KE_DEBUG_DISPLAY_ASSERTS 0x00000080u
|
||||
#define KE_DEBUG_DISPLAY_TRACE 0x00000100u
|
||||
#define KE_DEBUG_INPUT_TRACE 0x00000200u
|
||||
#define KE_DEBUG_VM_ASSERTS 0x00000400u
|
||||
#define KE_DEBUG_SYSCALL_ASSERTS 0x00000800u
|
||||
#define KE_DEBUG_LIST_CHECKS 0x00001000u
|
||||
#define KE_DEBUG_AUDIO 0x00002000u
|
||||
#define KE_DEBUG_AUDIO_SELFTEST 0x00004000u
|
||||
// Kernel boot debug flags. Keep these contiguous and document every bit in boot.ini.
|
||||
#define KE_DEBUG_CONSOLE 0x00000001u // Mirror debug output to the firmware/debug console.
|
||||
#define KE_DEBUG_SELFTEST 0x00000002u // Run kernel and SMP boot self-tests.
|
||||
#define KE_DEBUG_FILE_LOG 0x00000004u // Retain debug output for kernel.log persistence.
|
||||
#define KE_DEBUG_POOL_CANARY 0x00000008u // Validate pool block canaries.
|
||||
#define KE_DEBUG_POOL_POISON 0x00000010u // Poison released pool blocks.
|
||||
#define KE_DEBUG_POOL_QUARANTINE 0x00000020u // Delay reuse of released pool blocks.
|
||||
#define KE_DEBUG_POOL_CALLERS 0x00000040u // Track pool allocation/free callers.
|
||||
#define KE_DEBUG_DISPLAY_ASSERTS 0x00000080u // Enable display-path consistency assertions.
|
||||
#define KE_DEBUG_LIST_CHECKS 0x00000100u // Validate intrusive-list links on mutation.
|
||||
|
||||
#define KE_DEBUG_VALID_MASK (KE_DEBUG_CONSOLE | KE_DEBUG_SELFTEST | KE_DEBUG_FILE_LOG | \
|
||||
KE_DEBUG_POOL_CANARY | KE_DEBUG_POOL_POISON | \
|
||||
KE_DEBUG_POOL_QUARANTINE | KE_DEBUG_POOL_CALLERS | \
|
||||
KE_DEBUG_DISPLAY_ASSERTS | KE_DEBUG_LIST_CHECKS)
|
||||
|
||||
// Driver-visible debug output service table passed through NTL_DDK.
|
||||
typedef struct NTL_DDK_DEBUG {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Public nt-lite DDK filesystem declarations.
|
||||
// Public nt-lite DDK filesystem and mounted-volume declarations.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -43,30 +43,46 @@ typedef struct IO_FILE_IDENTITY {
|
||||
uint64_t Size;
|
||||
} IO_FILE_IDENTITY;
|
||||
|
||||
typedef struct IO_FILESYSTEM {
|
||||
KSTATUS (*Open)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW path, void** fileCtx);
|
||||
KSTATUS (*Read)(struct IO_FILESYSTEM* fs, void* fileCtx, uint64_t offset, void* buf, size_t size, size_t* bytesRead);
|
||||
KSTATUS (*Write)(struct IO_FILESYSTEM* fs, void* fileCtx, uint64_t offset, const void* buf, size_t size, size_t* bytesWritten);
|
||||
KSTATUS (*ReadAsync)(struct IO_FILESYSTEM* fs, void* fileCtx, uint64_t offset, void* buf, size_t size, IO_FS_ASYNC_COMPLETE complete, void* completeContext);
|
||||
KSTATUS (*WriteAsync)(struct IO_FILESYSTEM* fs, void* fileCtx, uint64_t offset, const void* buf, size_t size, IO_FS_ASYNC_COMPLETE complete, void* completeContext);
|
||||
KSTATUS (*Create)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW path, void** fileCtx);
|
||||
KSTATUS (*Delete)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW path);
|
||||
KSTATUS (*Rename)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW oldPath, SYS_STRING_VIEW newPath);
|
||||
KSTATUS (*CreateDir)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW path);
|
||||
KSTATUS (*RemoveDir)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW path);
|
||||
KSTATUS (*Truncate)(struct IO_FILESYSTEM* fs, void* fileCtx, uint64_t newSize, uint32_t fileFlags);
|
||||
uint64_t (*GetSize)(struct IO_FILESYSTEM* fs, void* fileCtx);
|
||||
KSTATUS (*QueryInfo)(struct IO_FILESYSTEM* fs, void* fileCtx, SYS_FILE_STAT* out);
|
||||
KSTATUS (*Stat)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW path, SYS_FILE_STAT* out);
|
||||
KSTATUS (*QueryIdentity)(struct IO_FILESYSTEM* fs, void* fileCtx, IO_FILE_IDENTITY* out);
|
||||
KSTATUS (*Flush)(struct IO_FILESYSTEM* fs, void* fileCtx);
|
||||
void (*Close)(struct IO_FILESYSTEM* fs, void* fileCtx);
|
||||
void (*QueryStats)(struct IO_FILESYSTEM* fs, IO_FILESYSTEM_STATS* out);
|
||||
void* DriverCtx;
|
||||
KSTATUS (*OpenDir)(struct IO_FILESYSTEM* fs, SYS_STRING_VIEW dirPath, void** dirCtx);
|
||||
KSTATUS (*ReadDir)(struct IO_FILESYSTEM* fs, void* dirCtx, KDIR_ENTRY* out);
|
||||
void (*CloseDir)(struct IO_FILESYSTEM* fs, void* dirCtx);
|
||||
} IO_FILESYSTEM;
|
||||
typedef enum IO_VOLUME_REMOVAL_REASON {
|
||||
IoVolumeUnmounted = 1,
|
||||
IoVolumeBackingRemoved,
|
||||
IoVolumeProviderDead,
|
||||
} IO_VOLUME_REMOVAL_REASON;
|
||||
|
||||
// Kernel filesystem providers implement this backend. IO_VOLUME owns a copy of
|
||||
// the dispatch and keeps Context alive until all file and directory references drain.
|
||||
typedef struct IO_VOLUME_PROVIDER {
|
||||
KSTATUS (*Open)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW path, void** fileCtx);
|
||||
KSTATUS (*Read)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, uint64_t offset, void* buf, size_t size, size_t* bytesRead);
|
||||
KSTATUS (*Write)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, uint64_t offset, const void* buf, size_t size, size_t* bytesWritten);
|
||||
KSTATUS (*ReadAsync)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, uint64_t offset, void* buf, size_t size, IO_FS_ASYNC_COMPLETE complete, void* completeContext);
|
||||
KSTATUS (*WriteAsync)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, uint64_t offset, const void* buf, size_t size, IO_FS_ASYNC_COMPLETE complete, void* completeContext);
|
||||
KSTATUS (*Create)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW path, void** fileCtx);
|
||||
KSTATUS (*Delete)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW path);
|
||||
KSTATUS (*Rename)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW oldPath, SYS_STRING_VIEW newPath);
|
||||
KSTATUS (*CreateDir)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW path);
|
||||
KSTATUS (*RemoveDir)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW path);
|
||||
KSTATUS (*Truncate)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, uint64_t newSize, uint32_t fileFlags);
|
||||
uint64_t (*GetSize)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx);
|
||||
KSTATUS (*QueryInfo)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, SYS_FILE_STAT* out);
|
||||
KSTATUS (*Stat)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW path, SYS_FILE_STAT* out);
|
||||
KSTATUS (*QueryIdentity)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx, IO_FILE_IDENTITY* out);
|
||||
KSTATUS (*Flush)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx);
|
||||
void (*Close)(struct IO_VOLUME_PROVIDER* provider, void* fileCtx);
|
||||
void (*QueryStats)(struct IO_VOLUME_PROVIDER* provider, IO_FILESYSTEM_STATS* out);
|
||||
KSTATUS (*OpenDir)(struct IO_VOLUME_PROVIDER* provider, SYS_STRING_VIEW dirPath, void** dirCtx);
|
||||
KSTATUS (*ReadDir)(struct IO_VOLUME_PROVIDER* provider, void* dirCtx, KDIR_ENTRY* out);
|
||||
void (*CloseDir)(struct IO_VOLUME_PROVIDER* provider, void* dirCtx);
|
||||
|
||||
// Called once when the mounted volume becomes unusable. It must not free Context.
|
||||
void (*VolumeDead)(struct IO_VOLUME_PROVIDER* provider, IO_VOLUME_REMOVAL_REASON reason);
|
||||
|
||||
// Called once after the final IO_VOLUME/file/directory reference drains.
|
||||
void (*Destroy)(struct IO_VOLUME_PROVIDER* provider);
|
||||
void* Context;
|
||||
} IO_VOLUME_PROVIDER;
|
||||
|
||||
typedef struct IO_VOLUME IO_VOLUME;
|
||||
|
||||
struct EVENT;
|
||||
struct KAPC;
|
||||
@@ -79,7 +95,7 @@ typedef struct IO_ASYNC_FILE_REQUEST_OBJECT IO_ASYNC_FILE_REQUEST_OBJECT;
|
||||
|
||||
typedef struct FILE_OBJECT {
|
||||
OBJECT Header;
|
||||
IO_FILESYSTEM* Fs;
|
||||
IO_VOLUME* Volume;
|
||||
void* FileCtx;
|
||||
SPINLOCK Lock;
|
||||
uint64_t Size;
|
||||
@@ -89,41 +105,58 @@ typedef struct FILE_OBJECT {
|
||||
|
||||
typedef struct DIR_OBJECT {
|
||||
OBJECT Header;
|
||||
IO_FILESYSTEM* Fs;
|
||||
IO_VOLUME* Volume;
|
||||
void* DirCtx;
|
||||
char* Path;
|
||||
size_t PathLength;
|
||||
} DIR_OBJECT;
|
||||
|
||||
typedef struct IO_VOLUME_PARAMS {
|
||||
uint8_t DiskIndex;
|
||||
uint64_t PartitionLba;
|
||||
uint64_t PartitionSize;
|
||||
} IO_VOLUME_PARAMS;
|
||||
typedef enum IO_VOLUME_SOURCE_TYPE {
|
||||
IoVolumeSourcePartition = 1,
|
||||
IoVolumeSourceBlockDevice,
|
||||
} IO_VOLUME_SOURCE_TYPE;
|
||||
|
||||
typedef struct IO_VOLUME_SOURCE {
|
||||
uint32_t Type;
|
||||
uint8_t DiskIndex;
|
||||
uint8_t Reserved[3];
|
||||
uint64_t StartLba;
|
||||
uint64_t SectorCount;
|
||||
} IO_VOLUME_SOURCE;
|
||||
|
||||
// Creates a mounted, refcounted volume and returns one caller reference.
|
||||
__declspec(dllexport) KSTATUS IoCreateVolume(const IO_VOLUME_PROVIDER* provider,
|
||||
const IO_VOLUME_SOURCE* source,
|
||||
IO_VOLUME** volumeOut);
|
||||
|
||||
// Marks a volume dead, removes it from the mounted-volume registry, and rejects future provider I/O.
|
||||
__declspec(dllexport) KSTATUS IoRemoveVolume(IO_VOLUME* volume, IO_VOLUME_REMOVAL_REASON reason);
|
||||
|
||||
// Releases a caller-owned volume reference returned by IoCreateVolume.
|
||||
__declspec(dllexport) void IoReleaseVolume(IO_VOLUME* volume);
|
||||
|
||||
// Returns the monotonic runtime instance identifier assigned to a mounted volume.
|
||||
__declspec(dllexport) uint32_t IoGetVolumeInstanceId(const IO_VOLUME* volume);
|
||||
|
||||
// Returns the immutable block source associated with a mounted volume.
|
||||
__declspec(dllexport) KSTATUS IoGetVolumeSource(const IO_VOLUME* volume, IO_VOLUME_SOURCE* sourceOut);
|
||||
|
||||
__declspec(dllexport) KSTATUS IoRegisterFilesystem(uint8_t driveIndex, IO_FILESYSTEM* fs, const IO_VOLUME_PARAMS* vol);
|
||||
__declspec(dllexport) KSTATUS IoUnregisterFilesystem(uint8_t driveIndex);
|
||||
__declspec(dllexport) KSTATUS IoUnregisterFilesystemsForDisk(uint8_t diskIndex);
|
||||
__declspec(dllexport) bool IoFilesystemPresent(uint8_t driveIndex);
|
||||
__declspec(dllexport) void IoQueryFilesystemStats(IO_FILESYSTEM_STATS* out);
|
||||
__declspec(dllexport) KSTATUS IoOpenFile(SYS_STRING_VIEW path, FILE_OBJECT** out);
|
||||
// Capability-relative native opens. Paths are canonical relative paths: '/' separators only,
|
||||
// no leading/trailing separator, empty components, '.', '..', backslash, or embedded NUL.
|
||||
__declspec(dllexport) KSTATUS IoOpenFileAtVolume(IO_VOLUME* volume, SYS_STRING_VIEW path, FILE_OBJECT** out);
|
||||
__declspec(dllexport) KSTATUS IoCreateFileAtVolume(IO_VOLUME* volume, SYS_STRING_VIEW path, FILE_OBJECT** out);
|
||||
__declspec(dllexport) KSTATUS IoOpenDirAtVolume(IO_VOLUME* volume, SYS_STRING_VIEW path, DIR_OBJECT** out);
|
||||
__declspec(dllexport) KSTATUS IoReadFile(FILE_OBJECT* file, void* buf, size_t size, size_t* bytesRead);
|
||||
__declspec(dllexport) KSTATUS IoReadFileAt(FILE_OBJECT* file, uint64_t offset, void* buf, size_t size, size_t* bytesRead);
|
||||
__declspec(dllexport) KSTATUS IoWriteFile(FILE_OBJECT* file, const void* buf, size_t size, size_t* bytesWritten);
|
||||
__declspec(dllexport) KSTATUS IoWriteFileAt(FILE_OBJECT* file, uint64_t offset, const void* buf, size_t size, size_t* bytesWritten);
|
||||
__declspec(dllexport) KSTATUS IoFlushFile(FILE_OBJECT* file);
|
||||
__declspec(dllexport) KSTATUS IoCreateFile(SYS_STRING_VIEW path, FILE_OBJECT** out);
|
||||
__declspec(dllexport) KSTATUS IoDeleteFile(SYS_STRING_VIEW path);
|
||||
__declspec(dllexport) KSTATUS IoRenameFile(SYS_STRING_VIEW oldPath, SYS_STRING_VIEW newPath);
|
||||
__declspec(dllexport) KSTATUS IoCreateDir(SYS_STRING_VIEW path);
|
||||
__declspec(dllexport) KSTATUS IoRemoveDir(SYS_STRING_VIEW path);
|
||||
__declspec(dllexport) KSTATUS IoTruncateFile(FILE_OBJECT* file, uint64_t newSize);
|
||||
__declspec(dllexport) KSTATUS IoSeekFile(FILE_OBJECT* file, uint64_t offset);
|
||||
__declspec(dllexport) uint64_t IoGetFileSize(FILE_OBJECT* file);
|
||||
__declspec(dllexport) KSTATUS IoGetFileStat(FILE_OBJECT* file, SYS_FILE_STAT* out);
|
||||
__declspec(dllexport) KSTATUS IoStatFile(SYS_STRING_VIEW path, SYS_FILE_STAT* out);
|
||||
__declspec(dllexport) KSTATUS IoQueryFileIdentity(FILE_OBJECT* file, IO_FILE_IDENTITY* out);
|
||||
__declspec(dllexport) void IoCloseFile(FILE_OBJECT* file);
|
||||
__declspec(dllexport) KSTATUS IoOpenDir(SYS_STRING_VIEW dirPath, DIR_OBJECT** out);
|
||||
__declspec(dllexport) KSTATUS IoReadDir(DIR_OBJECT* dir, KDIR_ENTRY* entryOut);
|
||||
__declspec(dllexport) void IoCloseDir(DIR_OBJECT* dir);
|
||||
__declspec(dllexport) KSTATUS IoSetCwd(SYS_STRING_VIEW path);
|
||||
__declspec(dllexport) KSTATUS IoRealPath(SYS_STRING_VIEW path, char* buffer, size_t bufferSize, size_t* requiredSizeOut);
|
||||
@@ -5,9 +5,16 @@
|
||||
#include <stdint.h>
|
||||
#include <ntlite/status.h>
|
||||
|
||||
typedef struct NTL_DDK_MSI_MESSAGE {
|
||||
uint64_t Address;
|
||||
uint32_t Data;
|
||||
uint32_t Reserved;
|
||||
} NTL_DDK_MSI_MESSAGE;
|
||||
|
||||
// Driver-visible interrupt services.
|
||||
typedef struct NTL_DDK_INTERRUPT {
|
||||
KSTATUS (*AllocateMsiVector)(uint8_t* outIrq);
|
||||
KSTATUS (*ComposeMsiMessage)(uint8_t irq, NTL_DDK_MSI_MESSAGE* messageOut);
|
||||
} NTL_DDK_INTERRUPT;
|
||||
|
||||
// Allocates one kernel IRQ slot for MSI delivery.
|
||||
|
||||
@@ -13,6 +13,12 @@ typedef uint8_t KIRQL;
|
||||
#define DIRQL_BASE ((KIRQL)16)
|
||||
#define HIGH_LEVEL ((KIRQL)31)
|
||||
|
||||
// Masks interrupts and returns an opaque state restored by KeRestoreInterrupts.
|
||||
__declspec(dllexport) uintptr_t KeDisableInterrupts(void);
|
||||
|
||||
// Restores the interrupt state returned by KeDisableInterrupts.
|
||||
__declspec(dllexport) void KeRestoreInterrupts(uintptr_t flags);
|
||||
|
||||
// Returns the current processor's software IRQL.
|
||||
__declspec(dllexport) KIRQL KeGetCurrentIrql(void);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef struct LIST_ENTRY {
|
||||
|
||||
// Recover the containing struct pointer from an embedded list node.
|
||||
#define CONTAINING_RECORD(ptr, type, member) \
|
||||
((type *)((char *)(ptr) - offsetof(type, member)))
|
||||
((type*)((char*)(ptr) - offsetof(type, member)))
|
||||
|
||||
// Inserts a node at the tail of a list.
|
||||
static inline void ListInsertTail(LIST_ENTRY* head, LIST_ENTRY* node) {
|
||||
|
||||
@@ -27,10 +27,13 @@ typedef enum OBJECT_TYPE {
|
||||
ObjectTypeInputQueue = 17,
|
||||
ObjectTypeImageSection = 18,
|
||||
ObjectTypeTimer = 19,
|
||||
ObjectTypeModule = 20,
|
||||
ObjectTypeDisplayClock = 21,
|
||||
ObjectTypeAudioEndpoint = 22,
|
||||
ObjectTypeAudioStream = 23,
|
||||
ObjectTypeDisplayClock = 20,
|
||||
ObjectTypeAudioEndpoint = 21,
|
||||
ObjectTypeAudioStream = 22,
|
||||
ObjectTypeSecurityContext = 23,
|
||||
ObjectTypePort = 24,
|
||||
ObjectTypeVolume = 25,
|
||||
ObjectTypeVolumeManager = 26,
|
||||
} OBJECT_TYPE;
|
||||
|
||||
typedef enum OBJECT_LIFETIME_STATE {
|
||||
|
||||
@@ -18,6 +18,4 @@ typedef struct NTL_DDK_PLATFORM {
|
||||
uint8_t function,
|
||||
uint16_t offset,
|
||||
uint32_t value);
|
||||
uint32_t (*GetBspLapicId)(void);
|
||||
uint8_t (*IsX2ApicEnabled)(void);
|
||||
} NTL_DDK_PLATFORM;
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stddef.h>
|
||||
#include <ntlite/status.h>
|
||||
|
||||
#define KE_SETTINGS_PATH "system\\settings.ini"
|
||||
#define KE_SETTINGS_PATH "system/settings.ini"
|
||||
|
||||
// Reads one string setting from the system settings file.
|
||||
__declspec(dllexport) KSTATUS KeGetSettingString(const char* section,
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <intrin.h>
|
||||
#include <ntlite/ddi/hal_api.h>
|
||||
#include <ntlite/ddk/irql.h>
|
||||
|
||||
// Legacy spinlock storage used by current driver-visible objects.
|
||||
@@ -38,7 +37,7 @@ static __forceinline KIRQL KiSpinlockCookieIrql(uintptr_t cookie) {
|
||||
|
||||
// Acquires a spinlock and raises to at least DISPATCH_LEVEL.
|
||||
static __forceinline uintptr_t KeAcquireSpinlock(SPINLOCK* sl) {
|
||||
uintptr_t flags = HalDisableInterrupts();
|
||||
uintptr_t flags = KeDisableInterrupts();
|
||||
|
||||
KIRQL oldIrql = KeGetCurrentIrql();
|
||||
if (oldIrql < DISPATCH_LEVEL)
|
||||
@@ -57,12 +56,12 @@ static __forceinline void KeReleaseSpinlock(SPINLOCK* sl, uintptr_t cookie) {
|
||||
|
||||
_InterlockedExchange(&sl->Locked, 0);
|
||||
KeLowerIrql(oldIrql);
|
||||
HalRestoreInterrupts(flags);
|
||||
KeRestoreInterrupts(flags);
|
||||
}
|
||||
|
||||
// Attempts to acquire a spinlock without blocking.
|
||||
static __forceinline int KeTryAcquireSpinlock(SPINLOCK* sl, uintptr_t* outCookie) {
|
||||
uintptr_t flags = HalDisableInterrupts();
|
||||
uintptr_t flags = KeDisableInterrupts();
|
||||
|
||||
KIRQL oldIrql = KeGetCurrentIrql();
|
||||
if (oldIrql < DISPATCH_LEVEL)
|
||||
@@ -74,7 +73,7 @@ static __forceinline int KeTryAcquireSpinlock(SPINLOCK* sl, uintptr_t* outCookie
|
||||
}
|
||||
|
||||
KeLowerIrql(oldIrql);
|
||||
HalRestoreInterrupts(flags);
|
||||
KeRestoreInterrupts(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user