mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:34:13 +08:00
mdbx: use <winternl.h> for Windows.
This commit is contained in:
parent
e6e92134a6
commit
ee9d0903c8
29
src/osal.c
29
src/osal.c
@ -17,6 +17,8 @@
|
|||||||
#include "./bits.h"
|
#include "./bits.h"
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
#include <winternl.h>
|
||||||
|
|
||||||
static int waitstatus2errcode(DWORD result) {
|
static int waitstatus2errcode(DWORD result) {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case WAIT_OBJECT_0:
|
case WAIT_OBJECT_0:
|
||||||
@ -53,25 +55,6 @@ static int ntstatus2errcode(NTSTATUS status) {
|
|||||||
* ntdll.dll, which is not linked by default in user code. */
|
* ntdll.dll, which is not linked by default in user code. */
|
||||||
#pragma comment(lib, "ntdll.lib")
|
#pragma comment(lib, "ntdll.lib")
|
||||||
|
|
||||||
#ifndef NT_SUCCESS
|
|
||||||
#define NT_SUCCESS(x) ((x) >= 0)
|
|
||||||
#define STATUS_SUCCESS ((NTSTATUS)0)
|
|
||||||
#endif
|
|
||||||
typedef struct _UNICODE_STRING {
|
|
||||||
USHORT Length;
|
|
||||||
USHORT MaximumLength;
|
|
||||||
PWSTR Buffer;
|
|
||||||
} UNICODE_STRING, *PUNICODE_STRING;
|
|
||||||
|
|
||||||
typedef struct _OBJECT_ATTRIBUTES {
|
|
||||||
ULONG Length;
|
|
||||||
HANDLE RootDirectory;
|
|
||||||
PUNICODE_STRING ObjectName;
|
|
||||||
ULONG Attributes;
|
|
||||||
PVOID SecurityDescriptor;
|
|
||||||
PVOID SecurityQualityOfService;
|
|
||||||
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
|
|
||||||
|
|
||||||
extern NTSTATUS NTAPI NtCreateSection(
|
extern NTSTATUS NTAPI NtCreateSection(
|
||||||
OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess,
|
OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess,
|
||||||
IN OPTIONAL POBJECT_ATTRIBUTES ObjectAttributes,
|
IN OPTIONAL POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
@ -104,14 +87,6 @@ extern NTSTATUS NTAPI NtFreeVirtualMemory(IN HANDLE ProcessHandle,
|
|||||||
IN OUT PULONG RegionSize,
|
IN OUT PULONG RegionSize,
|
||||||
IN ULONG FreeType);
|
IN ULONG FreeType);
|
||||||
|
|
||||||
typedef struct _IO_STATUS_BLOCK {
|
|
||||||
union {
|
|
||||||
NTSTATUS Status;
|
|
||||||
PVOID Pointer;
|
|
||||||
};
|
|
||||||
ULONG_PTR Information;
|
|
||||||
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
|
|
||||||
|
|
||||||
#ifndef FILE_PROVIDER_CURRENT_VERSION
|
#ifndef FILE_PROVIDER_CURRENT_VERSION
|
||||||
typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {
|
typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {
|
||||||
ULONG Version;
|
ULONG Version;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user