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
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
00096
00097
ProbeForWriteBoolean((PBOOLEAN)ServiceData);
00098
00099
00100
00101
00102
00103
00104
if (
KeI386VdmIoplAllowed) {
00105 *((PULONG)ServiceData) = V86_VIRTUAL_INT_EXTENSIONS;
00106 }
else {
00107
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 }
}