diff options
Diffstat (limited to 'private/mvdm/vdd/samples/sample1/fax32')
-rw-r--r-- | private/mvdm/vdd/samples/sample1/fax32/fax32.c | 248 | ||||
-rw-r--r-- | private/mvdm/vdd/samples/sample1/fax32/fax32.def | 8 | ||||
-rw-r--r-- | private/mvdm/vdd/samples/sample1/fax32/fax32.h | 29 | ||||
-rw-r--r-- | private/mvdm/vdd/samples/sample1/fax32/makefile | 11 | ||||
-rw-r--r-- | private/mvdm/vdd/samples/sample1/fax32/sources | 21 |
5 files changed, 317 insertions, 0 deletions
diff --git a/private/mvdm/vdd/samples/sample1/fax32/fax32.c b/private/mvdm/vdd/samples/sample1/fax32/fax32.c new file mode 100644 index 000000000..cb162b10e --- /dev/null +++ b/private/mvdm/vdd/samples/sample1/fax32/fax32.c @@ -0,0 +1,248 @@ +/*++ + * + * VDD v1.0 + * + * Copyright (c) 1991, Microsoft Corporation + * + * VDD.C - Sample VDD for NT-MVDM + * +--*/ +#include "fax32.h" +#include "vddsvc.h" + + +USHORT Sub16CS; +USHORT Sub16IP; + +BOOL +VDDInitialize( + IN PVOID DllHandle, + IN ULONG Reason, + IN PCONTEXT Context OPTIONAL + ) + +/*++ + +Routine Description: + + +Arguments: + + DllHandle - Not Used + + Reason - Attach or Detach + + Context - Not Used + +Return Value: + + SUCCESS - TRUE + FAILURE - FALSE + +--*/ + +{ + + switch ( Reason ) { + + case DLL_PROCESS_ATTACH: + // Allocate VDD's local heap if needed. Check that NT FAX driver + // is available by opening that device. + //.... + // Install user hook for callback service. + + if(!VDDInstallUserHook (DllHandle,&FAXVDDCreate, &FAXVDDTerminate, + &FAXVDDBlock, &FAXVDDResume)) + OutputDebugString("FAX32: UserHook not installed\n"); + else + OutputDebugString("FAX32: UserHook installed!\n"); + + // UserHook # 2 + if(!VDDInstallUserHook (DllHandle,&FAXVDDCreate, NULL, + NULL, &FAXVDDResume)) + OutputDebugString("FAX32: UserHook #2 not installed\n"); + else + OutputDebugString("FAX32: UserHook #2 installed!\n"); + + break; + + case DLL_PROCESS_DETACH: + // Deallocate VDD's local heap if needed + // communicate to appropriate Device driver about your departure + //... + // Deinstall user hook for callback service. + if(!VDDDeInstallUserHook (DllHandle)) + OutputDebugString("FAX32: UserHook not deinstalled\n"); + else + OutputDebugString("FAX32: UserHook deinstalled!\n"); + + break; + default: + break; + } + + return TRUE; +} + +// Sample function +VOID FAXVDDTerminate(USHORT usPDB) +{ + USHORT uSaveCS, uSaveIP; + + OutputDebugString("FAX32: Terminate message\n"); + + // VDDHostSimulate + + uSaveCS = getCS(); + uSaveIP = getIP(); + setCS(Sub16CS); + setIP(Sub16IP); + VDDSimulate16(); + setCS(uSaveCS); + setIP(uSaveIP); + +} + +// Sample function +VOID FAXVDDCreate(USHORT usPDB) +{ + OutputDebugString("FAX32: Create Message\n"); +} + +// Sample function +VOID FAXVDDBlock(VOID) +{ + OutputDebugString("FAX32: Block Message\n"); +} + +// Sample function +VOID FAXVDDResume(VOID) +{ + OutputDebugString("FAX32: Resume Message\n"); +} + + +VOID +FAXVDDTerminateVDM( + VOID + ) +/*++ + +Arguments: + +Return Value: + + SUCCESS - TRUE + FAILURE - FALSE + +--*/ + + +{ + + // Cleanup any resource taken for this vdm + + + return; +} + + +VOID +FAXVDDRegisterInit( + VOID + ) +/*++ + +Arguments: + +Return Value: + + SUCCESS - TRUE + FAILURE - FALSE + +--*/ + + +{ + // Save addresses for fax16 + Sub16CS = getDS(); + Sub16IP = getAX(); + + OutputDebugString("FAX32: GET_ADD\n"); + + // Called from the BOP manager. If VDDInitialize has done all the + // checking and resources alloaction, just return success. + + setCF(0); + return; +} + + +#define GET_A_FAX 1 +#define SEND_A_FAX 2 + +VOID +FAXVDDDispatch( + VOID + ) +/*++ + +Arguments: + Client (DX) = Command code + 01 - get a message from NT device driver + 02 - send a message through NT device driver + 03 - address of 16 bit routine + + Client (ES:BX) = Message Buffer + Client (CX) = Buffer Size + +Return Value: + + SUCCESS - Client Carry Clear and CX has the count transferred + FAILURE - Client Carry Set + +--*/ + + +{ +PCHAR Buffer; +USHORT cb; +USHORT uCom; +BOOL Success = TRUE; // In this sample operation always succeeds + + uCom = getDX(); + + cb = getCX(); + Buffer = (PCHAR) GetVDMPointer ((ULONG)((getES() << 16)|getBX()),cb,FALSE); + switch (uCom) { + case GET_A_FAX: + // Make a DeviceIOControl or ReadFile on NT FAX driver with + // cb and Buffer.Then set CX if success. + + if (Success) { + setCX(cb); + setCF(0); + } + else + setCF(1); + + break; + + + case SEND_A_FAX: + // Make a DeviceIOControl or WriteFile on NT FAX driver with + // cb and Buffer.Then set CX if success. + + if (Success) { + setCX(cb); + setCF(0); + } + else + setCF(1); + + break; + default: + setCF(1); + } + return; +} diff --git a/private/mvdm/vdd/samples/sample1/fax32/fax32.def b/private/mvdm/vdd/samples/sample1/fax32/fax32.def new file mode 100644 index 000000000..826d5579a --- /dev/null +++ b/private/mvdm/vdd/samples/sample1/fax32/fax32.def @@ -0,0 +1,8 @@ +LIBRARY VDD + +DESCRIPTION 'Sample ISV VDD for NT-MVDM' + +EXPORTS + FAXVDDDispatch + FAXVDDTerminateVDM + FAXVDDRegisterInit diff --git a/private/mvdm/vdd/samples/sample1/fax32/fax32.h b/private/mvdm/vdd/samples/sample1/fax32/fax32.h new file mode 100644 index 000000000..fc5c45650 --- /dev/null +++ b/private/mvdm/vdd/samples/sample1/fax32/fax32.h @@ -0,0 +1,29 @@ +/* vdd.h - main include file for the VDD + * + */ + + + +#ifdef WIN_32 +#define WIN +#define FLAT_32 +#define TRUE_IF_WIN32 1 +#else +#define TRUE_IF_WIN32 0 +#endif + +#ifdef WIN +#define _WINDOWS +#include "windows.h" +#endif + + + +BOOL VDDInitialize(PVOID,ULONG,PCONTEXT); +VOID FAXVDDTerminateVDM(VOID); +VOID FAXVDDInit (VOID); +VOID FAXVDDDispatch (VOID); +VOID FAXVDDTerminate(USHORT usPDB); +VOID FAXVDDCreate(USHORT usPDB); +VOID FAXVDDBlock(VOID); +VOID FAXVDDResume(VOID); diff --git a/private/mvdm/vdd/samples/sample1/fax32/makefile b/private/mvdm/vdd/samples/sample1/fax32/makefile new file mode 100644 index 000000000..85f1ecf36 --- /dev/null +++ b/private/mvdm/vdd/samples/sample1/fax32/makefile @@ -0,0 +1,11 @@ +# Sample VDD makefile +# +# Copyright (c) 1991, Microsoft Corporation +# + + +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/mvdm/vdd/samples/sample1/fax32/sources b/private/mvdm/vdd/samples/sample1/fax32/sources new file mode 100644 index 000000000..942d66469 --- /dev/null +++ b/private/mvdm/vdd/samples/sample1/fax32/sources @@ -0,0 +1,21 @@ +INDENTED_DIRECTIVES=1 + +MAJORCOMP=vdd +MINORCOMP=fax32 + +TARGETNAME=fax32 +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\ntvdm.lib + +DLLENTRY=VDDInitialize +DLLBASE=0x2000000 + +SOURCES=fax32.c + +C_DEFINES=-DWIN_32 -DDEBUG + +UMTYPE=windows +UMTEST= +UMLIBS= |