Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

dbgdllp.h File Reference

#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <ntsm.h>
#include <wdbgexts.h>
#include <ntdbg.h>

Go to the source code of this file.

Classes

struct  _DBGSS_CONTINUE_KEY

Defines

#define NOEXTAPI

Typedefs

typedef _DBGSS_CONTINUE_KEY DBGSS_CONTINUE_KEY
typedef _DBGSS_CONTINUE_KEYPDBGSS_CONTINUE_KEY

Functions

NTSTATUS DbgSspConnectToDbg (VOID)
NTSTATUS DbgSspSrvApiLoop (IN PVOID ThreadParameter)
NTSTATUS DbgSspCreateProcess (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PCLIENT_ID DebugUiClientId, IN PDBGKM_CREATE_PROCESS NewProcess)
NTSTATUS DbgSspCreateThread (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PDBGKM_CREATE_THREAD NewThread)
NTSTATUS DbgSspExitThread (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PDBGKM_EXIT_THREAD ExitThread)
NTSTATUS DbgSspExitProcess (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PDBGKM_EXIT_PROCESS ExitProcess)
NTSTATUS DbgSspException (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PDBGKM_EXCEPTION Exception)
NTSTATUS DbgSspLoadDll (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PDBGKM_LOAD_DLL LoadDll)
NTSTATUS DbgSspUnloadDll (IN PDBGSS_CONTINUE_KEY ContinueKey, IN PCLIENT_ID AppClientId, IN PDBGKM_UNLOAD_DLL UnloadDll)

Variables

HANDLE DbgSspApiPort
HANDLE DbgSspKmReplyPort
PDBGSS_UI_LOOKUP DbgSspUiLookUpRoutine
PDBGSS_SUBSYSTEMKEY_LOOKUP DbgSspSubsystemKeyLookupRoutine
PDBGSS_DBGKM_APIMSG_FILTER DbgSspKmApiMsgFilter


Define Documentation

#define NOEXTAPI
 

Definition at line 28 of file dbgdllp.h.


Typedef Documentation

typedef struct _DBGSS_CONTINUE_KEY DBGSS_CONTINUE_KEY
 

typedef struct _DBGSS_CONTINUE_KEY * PDBGSS_CONTINUE_KEY
 


Function Documentation

NTSTATUS DbgSspConnectToDbg VOID   ) 
 

Definition at line 25 of file dllssstb.c.

References DbgSspApiPort, DynamicQos, L, NtConnectPort(), NTSTATUS(), NULL, PortName, RtlInitUnicodeString(), and TRUE.

Referenced by DbgSsInitialize().

00029 : 00030 00031 This routine makes a connection between the caller and the 00032 DbgSs port in the Dbg subsystem. 00033 00034 Arguments: 00035 00036 None. 00037 00038 Return Value: 00039 00040 TBD. 00041 00042 --*/ 00043 00044 { 00045 NTSTATUS st; 00046 UNICODE_STRING PortName; 00047 SECURITY_QUALITY_OF_SERVICE DynamicQos; 00048 00049 // 00050 // Set up the security quality of service parameters to use over the 00051 // port. Use the most efficient (least overhead) - which is dynamic 00052 // rather than static tracking. 00053 // 00054 00055 DynamicQos.ImpersonationLevel = SecurityImpersonation; 00056 DynamicQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING; 00057 DynamicQos.EffectiveOnly = TRUE; 00058 00059 00060 RtlInitUnicodeString(&PortName,L"\\DbgSsApiPort"); 00061 st = NtConnectPort( 00062 &DbgSspApiPort, 00063 &PortName, 00064 &DynamicQos, 00065 NULL, 00066 NULL, 00067 NULL, 00068 NULL, 00069 0L 00070 ); 00071 00072 return st; 00073 00074 }

NTSTATUS DbgSspCreateProcess IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PCLIENT_ID  DebugUiClientId,
IN PDBGKM_CREATE_PROCESS  NewProcess
 

Definition at line 176 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00185 : 00186 00187 This function is called by emulation subsystems to report the 00188 creation of a new process to the Dbg subsystem. It is the 00189 responsibility of individual subsystems to track a process and its 00190 controlling DebugUi. 00191 00192 Arguments: 00193 00194 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00195 should this API complete successfully. 00196 00197 AppClientId - Supplies the address of the new thread's ClientId. 00198 00199 DebugUiClientId - Supplies the address of the ClientId of the user 00200 interface controlling the new thread. 00201 00202 NewProcess - Supplies the address of the NewProcess message as sent through 00203 the applications DebugPort. The calling subsystem may modify the 00204 SubSystemKey fields of this message. 00205 00206 Return Value: 00207 00208 TBD 00209 00210 --*/ 00211 00212 { 00213 00214 NTSTATUS st; 00215 DBGSS_APIMSG ApiMsg; 00216 00217 PDBGSS_CREATE_PROCESS args; 00218 00219 args = &ApiMsg.u.CreateProcessInfo; 00220 00221 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsCreateProcessApi,sizeof(*args),AppClientId,ContinueKey); 00222 00223 args->DebugUiClientId = *DebugUiClientId; 00224 args->NewProcess = *NewProcess; 00225 00226 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00227 00228 return st; 00229 00230 }

NTSTATUS DbgSspCreateThread IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PDBGKM_CREATE_THREAD  NewThread
 

Definition at line 126 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00134 : 00135 00136 This function is called by emulation subsystems to report the 00137 creation of a new thread to the Dbg subsystem. 00138 00139 Arguments: 00140 00141 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00142 should this API complete successfully. 00143 00144 AppClientId - Supplies the address of the new thread's ClientId. 00145 00146 NewThread - Supplies the address of the NewThread message as sent through 00147 the applications DebugPort. The calling subsystem may modify the 00148 SubSystemKey field of this message. 00149 00150 Return Value: 00151 00152 TBD 00153 00154 --*/ 00155 00156 { 00157 00158 NTSTATUS st; 00159 DBGSS_APIMSG ApiMsg; 00160 00161 PDBGKM_CREATE_THREAD args; 00162 00163 args = &ApiMsg.u.CreateThread; 00164 00165 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsCreateThreadApi,sizeof(*args),AppClientId, ContinueKey); 00166 00167 *args = *NewThread; 00168 00169 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00170 00171 return st; 00172 }

NTSTATUS DbgSspException IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PDBGKM_EXCEPTION  Exception
 

Definition at line 77 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00085 : 00086 00087 This function is called by emulation subsystems to report that 00088 an exception occured in a thread. 00089 00090 Arguments: 00091 00092 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00093 should this API complete successfully. 00094 00095 AppClientId - Supplies the address of the ClientId of the thread that 00096 encountered an exception. 00097 00098 Exception - Supplies the address of the Exception message as sent 00099 through the applications DebugPort. 00100 00101 Return Value: 00102 00103 TBD 00104 00105 --*/ 00106 00107 { 00108 00109 NTSTATUS st; 00110 DBGSS_APIMSG ApiMsg; 00111 00112 PDBGKM_EXCEPTION args; 00113 00114 args = &ApiMsg.u.Exception; 00115 00116 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsExceptionApi,sizeof(*args),AppClientId,ContinueKey); 00117 00118 *args = *Exception; 00119 00120 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00121 00122 return st; 00123 }

NTSTATUS DbgSspExitProcess IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PDBGKM_EXIT_PROCESS  ExitProcess
 

Definition at line 281 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00289 : 00290 00291 This function is called by emulation subsystems to report that 00292 a process is exiting. 00293 00294 Arguments: 00295 00296 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00297 should this API complete successfully. 00298 00299 AppClientId - Supplies the address of the ClientId of the last thread 00300 in the process to exit. 00301 00302 ExitProcess - Supplies the address of the ExitProcess message as sent 00303 through the applications DebugPort. 00304 00305 Return Value: 00306 00307 TBD 00308 00309 --*/ 00310 00311 { 00312 00313 NTSTATUS st; 00314 DBGSS_APIMSG ApiMsg; 00315 00316 PDBGKM_EXIT_PROCESS args; 00317 00318 args = &ApiMsg.u.ExitProcess; 00319 00320 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsExitProcessApi,sizeof(*args),AppClientId,ContinueKey); 00321 00322 *args = *ExitProcess; 00323 00324 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00325 00326 return st; 00327 }

NTSTATUS DbgSspExitThread IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PDBGKM_EXIT_THREAD  ExitThread
 

Definition at line 233 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00241 : 00242 00243 This function is called by emulation subsystems to report that 00244 a thread is exiting. 00245 00246 Arguments: 00247 00248 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00249 should this API complete successfully. 00250 00251 AppClientId - Supplies the address of the exiting thread's ClientId. 00252 00253 ExitThread - Supplies the address of the ExitThread message as sent 00254 through the applications DebugPort. 00255 00256 Return Value: 00257 00258 TBD 00259 00260 --*/ 00261 00262 { 00263 00264 NTSTATUS st; 00265 DBGSS_APIMSG ApiMsg; 00266 00267 PDBGKM_EXIT_THREAD args; 00268 00269 args = &ApiMsg.u.ExitThread; 00270 00271 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsExitThreadApi,sizeof(*args),AppClientId,ContinueKey); 00272 00273 *args = *ExitThread; 00274 00275 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00276 00277 return st; 00278 }

NTSTATUS DbgSspLoadDll IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PDBGKM_LOAD_DLL  LoadDll
 

Definition at line 330 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00338 : 00339 00340 This function is called by emulation subsystems to report that 00341 a a process has loaded a DLL 00342 00343 Arguments: 00344 00345 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00346 should this API complete successfully. 00347 00348 AppClientId - Supplies the address of the ClientId of the thread 00349 that mapped the section. 00350 00351 LoadDll - Supplies the address of the LoadDll message as sent 00352 through the applications DebugPort. 00353 00354 Return Value: 00355 00356 TBD 00357 00358 --*/ 00359 00360 { 00361 00362 NTSTATUS st; 00363 DBGSS_APIMSG ApiMsg; 00364 00365 PDBGKM_LOAD_DLL args; 00366 00367 args = &ApiMsg.u.LoadDll; 00368 00369 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsLoadDllApi,sizeof(*args),AppClientId,ContinueKey); 00370 00371 *args = *LoadDll; 00372 00373 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00374 00375 return st; 00376 }

NTSTATUS DbgSspSrvApiLoop IN PVOID  ThreadParameter  ) 
 

Definition at line 737 of file dllssstb.c.

References ASSERT, DbgSspApiPort, DbgSspKmReplyPort, FALSE, _DBGSS_CONTINUE_KEY::KmApiMsg, NT_SUCCESS, NtReplyPort(), NtReplyWaitReceivePort(), NtSetEvent(), NTSTATUS(), NULL, _DBGSS_CONTINUE_KEY::ReplyEvent, and RtlFreeHeap.

Referenced by DbgSsInitialize().

00743 : 00744 00745 This loop services Dbg Subsystem server originated messages. 00746 00747 Arguments: 00748 00749 ThreadParameter - Not used. 00750 00751 Return Value: 00752 00753 None. 00754 00755 --*/ 00756 00757 { 00758 DBGSRV_APIMSG DbgSrvApiMsg; 00759 PDBGSS_CONTINUE_KEY ContinueKey; 00760 NTSTATUS st; 00761 00762 for(;;) { 00763 00764 st = NtReplyWaitReceivePort( 00765 DbgSspApiPort, 00766 NULL, 00767 NULL, 00768 (PPORT_MESSAGE) &DbgSrvApiMsg 00769 ); 00770 00771 if (!NT_SUCCESS( st )) { 00772 continue; 00773 } 00774 00775 ASSERT(DbgSrvApiMsg.ApiNumber < DbgSrvMaxApiNumber); 00776 00777 switch (DbgSrvApiMsg.ApiNumber ) { 00778 case DbgSrvContinueApi : 00779 00780 // 00781 // Might want to implement continue status based callout 00782 // like DBG_TERMINATE_PROCESS/THREAD 00783 // 00784 00785 ContinueKey = (PDBGSS_CONTINUE_KEY) DbgSrvApiMsg.ContinueKey; 00786 ContinueKey->KmApiMsg.ReturnedStatus = DbgSrvApiMsg.ReturnedStatus; 00787 00788 if ( ContinueKey->ReplyEvent ) { 00789 st = NtSetEvent(ContinueKey->ReplyEvent,NULL); 00790 } else { 00791 st = NtReplyPort(DbgSspKmReplyPort, 00792 (PPORT_MESSAGE) &ContinueKey->KmApiMsg 00793 ); 00794 } 00795 00796 RtlFreeHeap(RtlProcessHeap(), 0, ContinueKey); 00797 break; 00798 default : 00799 ASSERT(FALSE); 00800 } 00801 } 00802 00803 // 00804 // Make the compiler happy 00805 // 00806 00807 return st; 00808 } }

NTSTATUS DbgSspUnloadDll IN PDBGSS_CONTINUE_KEY  ContinueKey,
IN PCLIENT_ID  AppClientId,
IN PDBGKM_UNLOAD_DLL  UnloadDll
 

Definition at line 379 of file dllssstb.c.

References DbgSspApiPort, NtRequestPort(), and NTSTATUS().

Referenced by DbgSsHandleKmApiMsg().

00387 : 00388 00389 This function is called by emulation subsystems to report that 00390 a a process has un-mapped a view of a section 00391 00392 Arguments: 00393 00394 ContinueKey - Supplies the captured DbgKm API message that needs a reply 00395 should this API complete successfully. 00396 00397 AppClientId - Supplies the address of the ClientId of the thread 00398 that mapped the section. 00399 00400 UnloadDll - Supplies the address of the UnloadDll message as sent 00401 through the applications DebugPort. 00402 00403 Return Value: 00404 00405 TBD 00406 00407 --*/ 00408 00409 { 00410 00411 NTSTATUS st; 00412 DBGSS_APIMSG ApiMsg; 00413 00414 PDBGKM_UNLOAD_DLL args; 00415 00416 args = &ApiMsg.u.UnloadDll; 00417 00418 DBGSS_FORMAT_API_MSG(ApiMsg,DbgSsUnloadDllApi,sizeof(*args),AppClientId,ContinueKey); 00419 00420 *args = *UnloadDll; 00421 00422 st = NtRequestPort(DbgSspApiPort, (PPORT_MESSAGE) &ApiMsg); 00423 00424 return st; 00425 }


Variable Documentation

HANDLE DbgSspApiPort
 

Definition at line 38 of file dbgdllp.h.

Referenced by DbgSspConnectToDbg(), DbgSspCreateProcess(), DbgSspCreateThread(), DbgSspException(), DbgSspExitProcess(), DbgSspExitThread(), DbgSspLoadDll(), DbgSspSrvApiLoop(), and DbgSspUnloadDll().

PDBGSS_DBGKM_APIMSG_FILTER DbgSspKmApiMsgFilter
 

Definition at line 42 of file dbgdllp.h.

Referenced by DbgSsHandleKmApiMsg(), and DbgSsInitialize().

HANDLE DbgSspKmReplyPort
 

Definition at line 39 of file dbgdllp.h.

Referenced by DbgSsHandleKmApiMsg(), DbgSsInitialize(), and DbgSspSrvApiLoop().

PDBGSS_SUBSYSTEMKEY_LOOKUP DbgSspSubsystemKeyLookupRoutine
 

Definition at line 41 of file dbgdllp.h.

Referenced by DbgSsHandleKmApiMsg(), and DbgSsInitialize().

PDBGSS_UI_LOOKUP DbgSspUiLookUpRoutine
 

Definition at line 40 of file dbgdllp.h.

Referenced by DbgSsHandleKmApiMsg(), and DbgSsInitialize().


Generated on Sat May 15 19:43:23 2004 for test by doxygen 1.3.7