uLib  User mode C/C++ extended API library for Win32 programmers.
Native Function Support (NTDLL).

Module Description

DynaLinks and Supplements for native functions.
#include <uLib/NtFunc.h>

The NTDLL APIs are primarily intended for native programs, f.ex. boot executables,
though many of them can be invoked from Win32 applications as well, if necessary.

These numerous functions are only partly documented by Microsoft Hardware Dev Center,
and some are documented in the Device Driver Kit (DDK), Windows Driver Kit (WDK), et c,
so it's recommended you get a reference book like e.g. Windows NT/2000 Native API Reference
to get to grips with the cybernetics underneath Win32.

It's recommended that beginner and intermediate programmers avoid using the native functions.

The NtFunc module requires Alex Ionescu's NDK for native type declarations.
Unfortunately, Alex's own SourceForge page for NDK is now dysfunctional. However
the NDK is currently available here: https://github.com/Microwave89/win7-x64-ndk
A slightly revised version of NDK 1.0 is also available with the uLib distribution.
The uLib revisions are mostly for integration purposes (mitigating clashes et c).

Note: All these NTDLL function pointer id's begin with a leading underscore,
to disambiguate them from any NTDLL.LIB species.

The <uLib/NtTypes.h> header, which pulls in the NDK types, is included by NtFunc.h.

Note
In _WIN64 builds, due to a problem with the declaration of struct TEB
in <ndk/peb_teb.h>, You must build uLib with _WIN32_WINNT (or WINVER) >= 0x0502
if You need to use this module! You specify these in <uLib/Common.h>.

Groups

 Initialization
 Module and Object initialization.
 
 Experimental and Supplementary API's
 These APIs are based on NTDLL functions.
 
 Process Manager Functions
 _NtQueryInformationProcess et cetera...
 
 Object Manager Functions
 _NtQueryObject et cetera...
 
 Executive Functions
 _NtQuerySystemInformation et cetera...
 
 Kernel Functions
 _NtYieldExecution et cetera...
 
 Kernel Debugger Functions
 _NtSystemDebugControl et cetera...
 
 User-Mode Kernel Debugging Functions
 _NtDebugActiveProcess et cetera...
 
 Input/Output Manager Functions
 _NtCreateFile et cetera...
 
 Loader Functions
 _LdrEnumResources et cetera...
 
 Memory Manager Functions
 _NtAllocateUserPhysicalPages et cetera...
 
 Security Subsystem Functions
 _NtOpenProcessToken et cetera...
 
 Runtime Library Functions
 Native runtime library functions.
 

Classes

struct  LDR_MODULE
 
struct  OBJECT_ATTRIBUTES64
 
struct  OBJECT_ATTRIBUTES32
 

Typedefs

typedef LDR_MODULEPLDR_MODULE
 
typedef EVENT_TRACE_HEADER * PEVENT_TRACE_HEADER
 
typedef const OBJECT_ATTRIBUTES * PCOBJECT_ATTRIBUTES
 
typedef OBJECT_ATTRIBUTES64POBJECT_ATTRIBUTES64
 
typedef const OBJECT_ATTRIBUTES64PCOBJECT_ATTRIBUTES64
 
typedef OBJECT_ATTRIBUTES32POBJECT_ATTRIBUTES32
 
typedef const OBJECT_ATTRIBUTES32PCOBJECT_ATTRIBUTES32
 

Class Documentation

◆ LDR_MODULE

struct LDR_MODULE

Modified WinE flavor of NDKs LDR_DATA_TABLE_ENTRY.

Definition at line 77 of file NtTypes.h.

Class Members
LIST_ENTRY InLoadOrderLinks

Circular (headless) list

LIST_ENTRY InMemoryOrderLinks

Circular (headless) list

LIST_ENTRY InInitializationOrderLinks

Circular (headless) list

PVOID BaseAddress
PVOID EntryPoint
ULONG SizeOfImage
UNICODE_STRING FullDllName
UNICODE_STRING BaseDllName
ULONG Flags
SHORT LoadCount

-1 means 'statically linked' (can't be unloaded).

SHORT TlsIndex
HANDLE SectionHandle
ULONG CheckSum
ULONG TimeDateStamp
HANDLE ActivationContext

◆ OBJECT_ATTRIBUTES64

struct OBJECT_ATTRIBUTES64

Definition at line 203 of file NtTypes.h.

Class Members
ULONG Length
ULONG64 RootDirectory HANDLE.
ULONG64 ObjectName PUNICODE_STRING.
ULONG Attributes
ULONG64 SecurityDescriptor PSECURITY_DESCRIPTOR.
ULONG64 SecurityQualityOfService PSECURITY_QUALITY_OF_SERVICE.

◆ OBJECT_ATTRIBUTES32

struct OBJECT_ATTRIBUTES32

Definition at line 216 of file NtTypes.h.

Class Members
ULONG Length
ULONG RootDirectory HANDLE.
ULONG ObjectName PUNICODE_STRING.
ULONG Attributes
ULONG SecurityDescriptor PSECURITY_DESCRIPTOR.
ULONG SecurityQualityOfService PSECURITY_QUALITY_OF_SERVICE.

Typedef Documentation

◆ PLDR_MODULE

Definition at line 102 of file NtTypes.h.

◆ PEVENT_TRACE_HEADER

typedef EVENT_TRACE_HEADER* PEVENT_TRACE_HEADER

Definition at line 194 of file NtTypes.h.

◆ PCOBJECT_ATTRIBUTES

typedef const OBJECT_ATTRIBUTES* PCOBJECT_ATTRIBUTES

Definition at line 199 of file NtTypes.h.

◆ POBJECT_ATTRIBUTES64

Definition at line 213 of file NtTypes.h.

◆ PCOBJECT_ATTRIBUTES64

Definition at line 214 of file NtTypes.h.

◆ POBJECT_ATTRIBUTES32

Definition at line 226 of file NtTypes.h.

◆ PCOBJECT_ATTRIBUTES32

Definition at line 227 of file NtTypes.h.