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

vdmentry.c File Reference

#include "vdmp.h"
#include <ntvdmp.h>

Go to the source code of this file.

Defines

#define AssertIrqlPassive()

Functions

NTSTATUS NtVdmControl (IN VDMSERVICECLASS Service, IN OUT PVOID ServiceData)


Define Documentation

 
#define AssertIrqlPassive  ) 
 

Definition at line 45 of file vdmentry.c.

Referenced by NtVdmControl().


Function Documentation

NTSTATUS NtVdmControl IN VDMSERVICECLASS  Service,
IN OUT PVOID  ServiceData
 

Definition at line 51 of file vdmentry.c.

References AssertIrqlPassive, EXCEPTION_EXECUTE_HANDLER, Ke386SetVdmInterruptHandler(), KeGetCurrentThread, KeI386VdmIoplAllowed, KeI386VirtualIntExtensions, NTSTATUS(), PAGED_CODE, ProbeForRead, ProbeForWriteBoolean, Status, USHORT, VdmpDelayInterrupt(), VdmpInitialize(), VdmpPrinterDirectIoClose(), VdmpPrinterDirectIoOpen(), VdmpPrinterInitialize(), VdmpQueueInterrupt(), VdmpStartExecution(), and VdmQueryDirectoryFile().

00057 : 00058 00059 386 specific routine which dispatches to the appropriate function 00060 based on service number. 00061 00062 Arguments: 00063 00064 Service -- Specifies what service is to be performed 00065 ServiceData -- Supplies a pointer to service specific data 00066 00067 Return Value: 00068 00069 if invalid service number: STATUS_INVALID_PARAMETER_1 00070 else see individual services. 00071 00072 00073 --*/ 00074 { 00075 NTSTATUS Status; 00076 00077 PAGED_CODE(); 00078 00079 // 00080 // Dispatch in descending order of frequency 00081 // 00082 if (Service == VdmStartExecution) { 00083 Status = VdmpStartExecution(); 00084 } else if (Service == VdmQueueInterrupt) { 00085 Status = VdmpQueueInterrupt(ServiceData); 00086 } else if (Service == VdmDelayInterrupt) { 00087 Status = VdmpDelayInterrupt(ServiceData); 00088 } else if (Service == VdmQueryDir) { 00089 Status = VdmQueryDirectoryFile(ServiceData); 00090 } else if (Service == VdmInitialize) { 00091 Status = VdmpInitialize(ServiceData); 00092 } else if (Service == VdmFeatures) { 00093 try { 00094 // 00095 // Verify that we were passed a valid user address 00096 // 00097 ProbeForWriteBoolean((PBOOLEAN)ServiceData); 00098 00099 // 00100 // Return the appropriate feature bits to notify 00101 // ntvdm which modes (if any) fast IF emulation is 00102 // available for 00103 // 00104 if (KeI386VdmIoplAllowed) { 00105 *((PULONG)ServiceData) = V86_VIRTUAL_INT_EXTENSIONS; 00106 } else { 00107 // remove this if pm extensions to be used 00108 *((PULONG)ServiceData) = KeI386VirtualIntExtensions & 00109 ~PM_VIRTUAL_INT_EXTENSIONS; 00110 } 00111 00112 } except(EXCEPTION_EXECUTE_HANDLER) { 00113 Status = GetExceptionCode(); 00114 } 00115 Status = STATUS_SUCCESS; 00116 00117 } else if (Service == VdmSetInt21Handler) { 00118 try { 00119 ProbeForRead(ServiceData, sizeof(VDMSET_INT21_HANDLER_DATA), 1); 00120 00121 Status = Ke386SetVdmInterruptHandler( 00122 KeGetCurrentThread()->ApcState.Process, 00123 0x21L, 00124 (USHORT)(((PVDMSET_INT21_HANDLER_DATA)ServiceData)->Selector), 00125 ((PVDMSET_INT21_HANDLER_DATA)ServiceData)->Offset, 00126 ((PVDMSET_INT21_HANDLER_DATA)ServiceData)->Gate32 00127 ); 00128 } except(EXCEPTION_EXECUTE_HANDLER) { 00129 Status = GetExceptionCode(); 00130 } 00131 00132 } else if (Service == VdmPrinterDirectIoOpen) { 00133 Status = VdmpPrinterDirectIoOpen(ServiceData); 00134 } else if (Service == VdmPrinterDirectIoClose) { 00135 Status = VdmpPrinterDirectIoClose(ServiceData); 00136 } else if (Service == VdmPrinterInitialize) { 00137 Status = VdmpPrinterInitialize(ServiceData); 00138 } else { 00139 Status = STATUS_INVALID_PARAMETER_1; 00140 } 00141 00142 00143 AssertIrqlPassive(); 00144 return Status; 00145 00146 } }


Generated on Sat May 15 19:46:07 2004 for test by doxygen 1.3.7