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
|
|
|
//
|
|
|
|
// Don't force inclusion of csrss header, leave this opaque.
|
|
|
|
//
|
2005-09-07 19:37:28 +00:00
|
|
|
struct _CSR_API_MESSAGE;
|
|
|
|
struct _CSR_CAPTURE_BUFFER;
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// CSR Functions
|
|
|
|
//
|
2005-09-07 19:37:28 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
CsrAllocateCaptureBuffer(
|
|
|
|
ULONG ArgumentCount,
|
|
|
|
ULONG BufferSize
|
|
|
|
);
|
|
|
|
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
CsrAllocateMessagePointer(
|
|
|
|
struct _CSR_CAPTURE_BUFFER *CaptureBuffer,
|
2005-11-22 04:57:45 +00:00
|
|
|
ULONG MessageLength,
|
|
|
|
PVOID *CaptureData
|
2005-09-07 19:37:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
CsrCaptureMessageBuffer(
|
|
|
|
struct _CSR_CAPTURE_BUFFER *CaptureBuffer,
|
2005-11-22 04:57:45 +00:00
|
|
|
PVOID MessageString,
|
|
|
|
ULONG StringLength,
|
|
|
|
PVOID *CapturedData
|
2005-09-07 19:37:28 +00:00
|
|
|
);
|
|
|
|
|
Large change to modify NTDLL'S CSR Functions to be compatible with NT. They are external and we should at least try to match the number of arguments (one vs eight? come on!). Because this is also the direction that Emanuele wants to be taking, the whole external calling interface was modified to be more compatible with NT (although internally it still isn't, and does not have a reason to be). API Names are now generated by a macro from the Server ID, like Emanuele and I noticed from traces, and I've entirely removed the concept of a reply structure. CSRSS uses full-duplex one-way structures, not dual-strutures (this would've been incompatible with the external interface anyways). I don't seem to have introduced any new bugs (console-ROS works great for me, as does the GUI), but there is still a chance some obscure bug might happen, so please bear with me, I had to hand-edit over 250 calls. Also, this now allows full removal of ntdll headers and the next commits will clean this up
svn path=/trunk/; revision=16213
2005-06-22 04:02:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
Large change to modify NTDLL'S CSR Functions to be compatible with NT. They are external and we should at least try to match the number of arguments (one vs eight? come on!). Because this is also the direction that Emanuele wants to be taking, the whole external calling interface was modified to be more compatible with NT (although internally it still isn't, and does not have a reason to be). API Names are now generated by a macro from the Server ID, like Emanuele and I noticed from traces, and I've entirely removed the concept of a reply structure. CSRSS uses full-duplex one-way structures, not dual-strutures (this would've been incompatible with the external interface anyways). I don't seem to have introduced any new bugs (console-ROS works great for me, as does the GUI), but there is still a chance some obscure bug might happen, so please bear with me, I had to hand-edit over 250 calls. Also, this now allows full removal of ntdll headers and the next commits will clean this up
svn path=/trunk/; revision=16213
2005-06-22 04:02:32 +00:00
|
|
|
CsrClientConnectToServer(
|
|
|
|
PWSTR ObjectDirectory,
|
|
|
|
ULONG ServerId,
|
2005-09-07 19:37:28 +00:00
|
|
|
PVOID ConnectionInfo,
|
|
|
|
PULONG ConnectionInfoSize,
|
2005-08-11 00:01:17 +00:00
|
|
|
PBOOLEAN ServerToServerCall
|
Large change to modify NTDLL'S CSR Functions to be compatible with NT. They are external and we should at least try to match the number of arguments (one vs eight? come on!). Because this is also the direction that Emanuele wants to be taking, the whole external calling interface was modified to be more compatible with NT (although internally it still isn't, and does not have a reason to be). API Names are now generated by a macro from the Server ID, like Emanuele and I noticed from traces, and I've entirely removed the concept of a reply structure. CSRSS uses full-duplex one-way structures, not dual-strutures (this would've been incompatible with the external interface anyways). I don't seem to have introduced any new bugs (console-ROS works great for me, as does the GUI), but there is still a chance some obscure bug might happen, so please bear with me, I had to hand-edit over 250 calls. Also, this now allows full removal of ntdll headers and the next commits will clean this up
svn path=/trunk/; revision=16213
2005-06-22 04:02:32 +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
|
|
|
CsrClientCallServer(
|
Large change to modify NTDLL'S CSR Functions to be compatible with NT. They are external and we should at least try to match the number of arguments (one vs eight? come on!). Because this is also the direction that Emanuele wants to be taking, the whole external calling interface was modified to be more compatible with NT (although internally it still isn't, and does not have a reason to be). API Names are now generated by a macro from the Server ID, like Emanuele and I noticed from traces, and I've entirely removed the concept of a reply structure. CSRSS uses full-duplex one-way structures, not dual-strutures (this would've been incompatible with the external interface anyways). I don't seem to have introduced any new bugs (console-ROS works great for me, as does the GUI), but there is still a chance some obscure bug might happen, so please bear with me, I had to hand-edit over 250 calls. Also, this now allows full removal of ntdll headers and the next commits will clean this up
svn path=/trunk/; revision=16213
2005-06-22 04:02:32 +00:00
|
|
|
struct _CSR_API_MESSAGE *Request,
|
2005-09-07 19:37:28 +00:00
|
|
|
struct _CSR_CAPTURE_BUFFER *CaptureBuffer OPTIONAL,
|
Large change to modify NTDLL'S CSR Functions to be compatible with NT. They are external and we should at least try to match the number of arguments (one vs eight? come on!). Because this is also the direction that Emanuele wants to be taking, the whole external calling interface was modified to be more compatible with NT (although internally it still isn't, and does not have a reason to be). API Names are now generated by a macro from the Server ID, like Emanuele and I noticed from traces, and I've entirely removed the concept of a reply structure. CSRSS uses full-duplex one-way structures, not dual-strutures (this would've been incompatible with the external interface anyways). I don't seem to have introduced any new bugs (console-ROS works great for me, as does the GUI), but there is still a chance some obscure bug might happen, so please bear with me, I had to hand-edit over 250 calls. Also, this now allows full removal of ntdll headers and the next commits will clean this up
svn path=/trunk/; revision=16213
2005-06-22 04:02:32 +00:00
|
|
|
ULONG ApiNumber,
|
|
|
|
ULONG RequestLength
|
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
|
|
|
CsrIdentifyAlertableThread(
|
|
|
|
VOID
|
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-09-07 19:37:28 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
CsrFreeCaptureBuffer(
|
|
|
|
struct _CSR_CAPTURE_BUFFER *CaptureBuffer
|
|
|
|
);
|
2005-09-07 19:37:28 +00:00
|
|
|
|
2006-06-28 17:02:37 +00:00
|
|
|
HANDLE
|
|
|
|
NTAPI
|
|
|
|
CsrGetProcessId(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
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
|
|
|
CsrNewThread(VOID);
|
|
|
|
|
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
|
|
|
CsrSetPriorityClass(
|
|
|
|
HANDLE Process,
|
|
|
|
PULONG PriorityClass
|
|
|
|
);
|
|
|
|
|
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
|
|
|
CsrProbeForRead(
|
2005-09-07 19:37:28 +00:00
|
|
|
IN PVOID Address,
|
2005-06-21 02:08:42 +00:00
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Alignment
|
|
|
|
);
|
|
|
|
|
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
|
|
|
CsrProbeForWrite(
|
2005-09-07 19:37:28 +00:00
|
|
|
IN PVOID Address,
|
2005-06-21 02:08:42 +00:00
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Alignment
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Debug Functions
|
|
|
|
//
|
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(
|
|
|
|
IN ULONG Status
|
|
|
|
);
|
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(
|
2005-11-22 04:57:45 +00:00
|
|
|
IN PCLIENT_ID ClientId,
|
2006-10-22 21:19:34 +00:00
|
|
|
IN NTSTATUS ContinueStatus
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2006-06-28 17:02:37 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgUiDebugActiveProcess(
|
|
|
|
IN HANDLE Process
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgUiStopDebugging(
|
|
|
|
IN HANDLE Process
|
|
|
|
);
|
|
|
|
|
2010-08-13 14:12:45 +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(
|
2005-11-22 04:57:45 +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(
|
|
|
|
IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange,
|
2006-10-23 05:49:07 +00:00
|
|
|
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(
|
|
|
|
IN HANDLE Process
|
|
|
|
);
|
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(
|
|
|
|
IN ULONG Flags,
|
|
|
|
IN PVOID BaseAddress
|
|
|
|
);
|
|
|
|
|
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(
|
|
|
|
IN PVOID BaseAddress
|
|
|
|
);
|
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(
|
2005-09-04 18:00:59 +00:00
|
|
|
IN PWSTR DllPath OPTIONAL,
|
|
|
|
IN PULONG DllCharacteristics,
|
2005-06-21 02:08:42 +00:00
|
|
|
IN PUNICODE_STRING DllName,
|
2005-09-04 18:00:59 +00:00
|
|
|
OUT PVOID *DllHandle
|
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
|
|
|
LdrFindEntryForAddress(
|
|
|
|
IN PVOID Address,
|
|
|
|
OUT PLDR_DATA_TABLE_ENTRY *Module
|
|
|
|
);
|
|
|
|
|
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(
|
|
|
|
IN PVOID BaseAddress,
|
|
|
|
IN PANSI_STRING Name,
|
|
|
|
IN ULONG Ordinal,
|
|
|
|
OUT PVOID *ProcedureAddress
|
|
|
|
);
|
|
|
|
|
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(
|
|
|
|
IN PWSTR SearchPath OPTIONAL,
|
2006-05-10 17:47:44 +00:00
|
|
|
IN PULONG LoadFlags OPTIONAL,
|
2005-06-21 02:08:42 +00:00
|
|
|
IN PUNICODE_STRING Name,
|
|
|
|
OUT PVOID *BaseAddress OPTIONAL
|
|
|
|
);
|
|
|
|
|
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(
|
2006-05-10 17:47:44 +00:00
|
|
|
IN ULONG_PTR Address,
|
|
|
|
IN ULONG Count,
|
2005-06-21 02:08:42 +00:00
|
|
|
IN PUSHORT TypeOffset,
|
2006-05-10 17:47:44 +00:00
|
|
|
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(
|
|
|
|
IN PUNICODE_STRING SubKey,
|
|
|
|
IN PCWSTR ValueName,
|
|
|
|
IN ULONG ValueSize,
|
|
|
|
OUT PVOID Buffer,
|
|
|
|
IN ULONG BufferSize,
|
|
|
|
OUT PULONG RetunedLength OPTIONAL
|
|
|
|
);
|
|
|
|
|
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(
|
2005-11-20 17:16:11 +00:00
|
|
|
IN PRTL_PROCESS_MODULES ModuleInformation OPTIONAL,
|
2005-06-21 04:52:46 +00:00
|
|
|
IN ULONG Size OPTIONAL,
|
|
|
|
OUT PULONG ReturnedSize
|
|
|
|
);
|
|
|
|
|
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(
|
|
|
|
IN PVOID BaseAddress
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2010-11-27 00:10:47 +00:00
|
|
|
typedef VOID (NTAPI *PLDR_CALLBACK)(PVOID CallbackContext, PVOID 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(
|
|
|
|
IN HANDLE FileHandle,
|
2010-11-20 22:05:42 +00:00
|
|
|
IN PLDR_CALLBACK Callback,
|
|
|
|
IN PVOID CallbackContext,
|
|
|
|
OUT PUSHORT ImageCharacterstics
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|