Twain_DSM  1.0
Classes | Public Member Functions | Private Attributes | List of all members
CTwHook Class Reference

The hook class... More...

Collaboration diagram for CTwHook:
Collaboration graph
[legend]

Classes

struct  Pod
 

Public Member Functions

bool Hook (EHOOK _ehook)
 Derived from John Robbins' BugSlayer code in MSJ (so the 'I' in the comments in this function refers to John), this function hooks or unhooks the stuff we want to examine. More...
 
bool DSID_Is_Hooked (TW_UINT32 DSID)
 Determine if the DS has been hooked by checking the ID. More...
 
void Hook_Add_DSID (TW_UINT32 DSID)
 Add this DS to the list of being hooked. More...
 
bool Hook_Remove_DSID (TW_UINT32 DSID)
 Remove this DS from the list of being hooked. More...
 

Private Attributes

struct CTwHook::Pod pod
 

Detailed Description

The hook class...

Definition at line 183 of file hook.cpp.

Member Function Documentation

◆ DSID_Is_Hooked()

bool CTwHook::DSID_Is_Hooked ( TW_UINT32  DSID)

Determine if the DS has been hooked by checking the ID.

Parameters
[in]DSIDThe DS ID to check to see if it has been hooked
Returns
true or false

Definition at line 581 of file hook.cpp.

References MAX_NUM_DS.

◆ Hook()

bool CTwHook::Hook ( EHOOK  _ehook)

Derived from John Robbins' BugSlayer code in MSJ (so the 'I' in the comments in this function refers to John), this function hooks or unhooks the stuff we want to examine.

Note that this code is optimized to hook the Ldr functions in ntdll.dll. If you want to hook something else, especially if it's in a different DLL, you're going to have some work to do...

Parameters
[in]EHOOK_ehook we're hooking or unhooking
Returns
true or false

Definition at line 308 of file hook.cpp.

References SSTRCAT.

◆ Hook_Add_DSID()

void CTwHook::Hook_Add_DSID ( TW_UINT32  DSID)

Add this DS to the list of being hooked.

Parameters
[in]DSIDThe DS ID to add to the list
Note
We allow an application to open the DSM several times and each application to open several DSs. (The application must use a different name each time it loads the DSM). It is possible for a DS to be opened several times by different applications. (Although most DSs only support one connection.) Therefore we need to allow multiple instances of the same DSID. No duplicate check needed.

Definition at line 604 of file hook.cpp.

◆ Hook_Remove_DSID()

bool CTwHook::Hook_Remove_DSID ( TW_UINT32  DSID)

Remove this DS from the list of being hooked.

Parameters
[in]DSIDThe DS ID to remove from the list
Returns
true or false

Definition at line 615 of file hook.cpp.

References kLOG, kLOGERR, and MAX_NUM_DS.


The documentation for this class was generated from the following file: