2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
|
|
|
|
|
|
|
Header Name:
|
|
|
|
|
|
|
|
umfuncs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Function definitions for Native DLL (ntdll) APIs exclusive to User Mode.
|
|
|
|
|
|
|
|
Author:
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
--*/
|
|
|
|
|
2005-06-21 02:08:42 +00:00
|
|
|
#ifndef _UMFUNCS_H
|
|
|
|
#define _UMFUNCS_H
|
|
|
|
|
2005-11-25 00:17:40 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
|
|
|
#include <umtypes.h>
|
|
|
|
#include <dbgktypes.h>
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Debug Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
__analysis_noreturn
|
2005-09-23 07:19:47 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
DbgBreakPointWithStatus(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Status
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
DbgUiConnectToDbg(
|
|
|
|
VOID
|
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
DbgUiContinue(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCLIENT_ID ClientId,
|
|
|
|
_In_ NTSTATUS ContinueStatus
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2006-06-28 17:02:37 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgUiDebugActiveProcess(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Process
|
2006-06-28 17:02:37 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgUiStopDebugging(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Process
|
2006-06-28 17:02:37 +00:00
|
|
|
);
|
|
|
|
|
2011-02-10 13:01:39 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
DbgUiWaitStateChange(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange,
|
|
|
|
_In_ PLARGE_INTEGER TimeOut
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2006-10-22 21:19:34 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgUiConvertStateChangeStructure(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PDBGUI_WAIT_STATE_CHANGE WaitStateChange,
|
|
|
|
_In_ PVOID DebugEvent
|
2006-10-22 21:19:34 +00:00
|
|
|
);
|
|
|
|
|
2005-07-12 01:56:14 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
DbgUiRemoteBreakin(
|
|
|
|
VOID
|
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
DbgUiIssueRemoteBreakin(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Process
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2006-06-28 17:02:37 +00:00
|
|
|
HANDLE
|
|
|
|
NTAPI
|
|
|
|
DbgUiGetThreadDebugObject(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Loader Functions
|
|
|
|
//
|
2006-01-12 04:31:37 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrAddRefDll(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID BaseAddress
|
2006-01-12 04:31:37 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
LdrDisableThreadCalloutsForDll(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrGetDllHandle(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ PWSTR DllPath,
|
|
|
|
_In_ PULONG DllCharacteristics,
|
|
|
|
_In_ PUNICODE_STRING DllName,
|
|
|
|
_Out_ PVOID *DllHandle
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2011-11-02 23:37:38 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
LdrGetDllHandleEx(
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ PWSTR DllPath,
|
|
|
|
_In_opt_ PULONG DllCharacteristics,
|
|
|
|
_In_ PUNICODE_STRING DllName,
|
|
|
|
_Out_opt_ PVOID *DllHandle);
|
2011-11-02 23:37:38 +00:00
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrFindEntryForAddress(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Address,
|
|
|
|
_Out_ PLDR_DATA_TABLE_ENTRY *Module
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrGetProcedureAddress(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PANSI_STRING Name,
|
|
|
|
_In_ ULONG Ordinal,
|
|
|
|
_Out_ PVOID *ProcedureAddress
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrInitializeThunk(
|
|
|
|
ULONG Unknown1,
|
|
|
|
ULONG Unknown2,
|
|
|
|
ULONG Unknown3,
|
|
|
|
ULONG Unknown4
|
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrLoadDll(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ PWSTR SearchPath,
|
|
|
|
_In_opt_ PULONG LoadFlags,
|
|
|
|
_In_ PUNICODE_STRING Name,
|
|
|
|
_Out_opt_ PVOID *BaseAddress
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
PIMAGE_BASE_RELOCATION
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrProcessRelocationBlock(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG_PTR Address,
|
|
|
|
_In_ ULONG Count,
|
|
|
|
_In_ PUSHORT TypeOffset,
|
|
|
|
_In_ LONG_PTR Delta
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrQueryImageFileExecutionOptions(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubKey,
|
|
|
|
_In_ PCWSTR ValueName,
|
|
|
|
_In_ ULONG ValueSize,
|
|
|
|
_Out_ PVOID Buffer,
|
|
|
|
_In_ ULONG BufferSize,
|
|
|
|
_Out_opt_ PULONG RetunedLength
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 04:52:46 +00:00
|
|
|
LdrQueryProcessModuleInformation(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ PRTL_PROCESS_MODULES ModuleInformation,
|
|
|
|
_In_opt_ ULONG Size,
|
|
|
|
_Out_ PULONG ReturnedSize
|
2005-06-21 04:52:46 +00:00
|
|
|
);
|
|
|
|
|
2015-03-01 15:34:06 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
LdrSetDllManifestProber(
|
|
|
|
_In_ PLDR_MANIFEST_PROBER_ROUTINE Routine);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
LdrShutdownProcess(
|
|
|
|
VOID
|
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
LdrShutdownThread(
|
|
|
|
VOID
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
LdrUnloadDll(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2012-01-30 09:43:24 +00:00
|
|
|
typedef VOID (NTAPI *PLDR_CALLBACK)(PVOID CallbackContext, PCHAR Name);
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
LdrVerifyImageMatchesChecksum(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE FileHandle,
|
|
|
|
_In_ PLDR_CALLBACK Callback,
|
|
|
|
_In_ PVOID CallbackContext,
|
|
|
|
_Out_ PUSHORT ImageCharacterstics
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2012-01-15 03:16:00 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrOpenImageFileOptionsKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubKey,
|
|
|
|
_In_ BOOLEAN Wow64,
|
|
|
|
_Out_ PHANDLE NewKeyHandle
|
2012-01-15 03:16:00 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
LdrQueryImageFileKeyOption(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE KeyHandle,
|
|
|
|
_In_ PCWSTR ValueName,
|
|
|
|
_In_ ULONG Type,
|
|
|
|
_Out_ PVOID Buffer,
|
|
|
|
_In_ ULONG BufferSize,
|
|
|
|
_Out_opt_ PULONG ReturnedLength
|
2012-01-15 03:16:00 +00:00
|
|
|
);
|
|
|
|
|
2005-06-21 02:08:42 +00:00
|
|
|
#endif
|