48#define MAX_VDD_MODULES 0xFF + 1
52#define ENTRY_TO_HANDLE(Entry) ((Entry) + 1)
53#define HANDLE_TO_ENTRY(Handle) ((Handle) - 1)
54#define IS_VALID_HANDLE(Handle) ((Handle) > 0 && (Handle) <= MAX_VDD_MODULES)
85 InitRoutineName =
NULL,
86 DispatchRoutineName =
NULL;
89 DispatchRoutine =
NULL;
91 DPRINT(
"RegisterModule() called\n");
100 DPRINT1(
"Failed to create a new VDD module entry\n");
116 DPRINT1(
"DllName = '%s' - InitRoutineName = '%s' - DispatchRoutineName = '%s'\n",
117 (DllName ? DllName :
"n/a"),
118 (InitRoutineName ? InitRoutineName :
"n/a"),
119 (DispatchRoutineName ? DispatchRoutineName :
"n/a"));
130 DPRINT1(
"Not enough memory to load DLL '%s'\n", DllName);
136 DPRINT1(
"Failed to load DLL '%s'; last error = %d\n", DllName, LastError);
146 if (InitRoutine ==
NULL)
148 DPRINT1(
"Failed to load the initialization routine '%s'\n", InitRoutineName);
157 if (DispatchRoutine ==
NULL)
159 DPRINT1(
"Failed to load the dispatch routine '%s'\n", DispatchRoutineName);
172 if (InitRoutine) InitRoutine();
202 DPRINT(
"UnRegisterModule() called\n");
226 DPRINT(
"DispatchCall() called\n");
246 DPRINT1(
"Unknown 3rd-party VDD BOP Function: 0x%02X\n", FuncNum);
256#define ERROR_MEMORYVDD L"Insufficient memory to load installable Virtual Device Drivers."
257#define ERROR_REGVDD L"Virtual Device Driver format in the registry is invalid."
258#define ERROR_LOADVDD L"An installable Virtual Device Driver failed Dll initialization."
266 LPCWSTR VDDKeyName =
L"SYSTEM\\CurrentControlSet\\Control\\VirtualDeviceDrivers";
395 if (UserHook ==
NULL)
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define RegCloseKey(hKey)
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
#define ERROR_NOT_ENOUGH_MEMORY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
VOID EmulatorTerminate(VOID)
#define TO_LINEAR(seg, off)
#define SEG_OFF_TO_PTR(seg, off)
#define RemoveEntryList(Entry)
#define InsertHeadList(ListHead, Entry)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ERROR_FILE_NOT_FOUND
VOID(WINAPI * PFNVDD_URESUME)(VOID)
VOID(WINAPI * PFNVDD_UTERMINATE)(USHORT DosPDB)
VOID(WINAPI * PFNVDD_UCREATE)(USHORT DosPDB)
VOID(WINAPI * PFNVDD_UBLOCK)(VOID)
base of all file and directory entries
struct _LIST_ENTRY * Flink
PFNVDD_UBLOCK Ublock_Handler
PFNVDD_UTERMINATE Uterm_Handler
PFNVDD_UCREATE Ucr_Handler
PFNVDD_URESUME Uresume_Handler
#define CONTAINING_RECORD(address, type, field)
BOOL WINAPI VDDInstallUserHook(IN HANDLE hVdd, IN PFNVDD_UCREATE Ucr_Handler, IN PFNVDD_UTERMINATE Uterm_Handler, IN PFNVDD_UBLOCK Ublock_Handler, IN PFNVDD_URESUME Uresume_Handler)
struct _VDD_USER_HANDLERS * PVDD_USER_HANDLERS
#define ENTRY_TO_HANDLE(Entry)
#define IS_VALID_HANDLE(Handle)
static LIST_ENTRY VddUserHooksList
VOID VDDBlockUserHook(VOID)
#define HANDLE_TO_ENTRY(Handle)
BOOL WINAPI VDDDeInstallUserHook(IN HANDLE hVdd)
static USHORT GetNextFreeVDDEntry(VOID)
VOID(WINAPI * VDD_PROC)(VOID)
static BOOL LoadInstallableVDD(VOID)
struct _VDD_MODULE VDD_MODULE
static VOID WINAPI ThirdPartyVDDBop(LPWORD Stack)
struct _VDD_MODULE * PVDD_MODULE
VOID VDDCreateUserHook(USHORT DosPDB)
static VDD_MODULE VDDList[MAX_VDD_MODULES]
VOID VDDTerminateUserHook(USHORT DosPDB)
struct _VDD_USER_HANDLERS VDD_USER_HANDLERS
VOID VDDSupInitialize(VOID)
VOID VDDResumeUserHook(VOID)
USHORT WINAPI getIP(VOID)
USHORT WINAPI getBX(VOID)
USHORT WINAPI getDS(VOID)
USHORT WINAPI getSI(VOID)
USHORT WINAPI getAX(VOID)
USHORT WINAPI getES(VOID)
USHORT WINAPI getDI(VOID)
USHORT WINAPI getCS(VOID)
VOID WINAPI setAX(USHORT)
VOID WINAPI setIP(USHORT)
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE