Example #1
0
/*
 * @implemented
 */
NTSTATUS
NTAPI
NtVdmControl(IN ULONG ControlCode,
             IN PVOID ControlData)
{
    NTSTATUS Status;
    PAGED_CODE();

    /* Check which control code this is */
    switch (ControlCode)
    {
        /* VDM Execution start */
        case VdmStartExecution:

            /* Call the sub-function */
            Status = VdmpStartExecution();
            break;

        case VdmInitialize:

            /* Call the init sub-function */
            Status = VdmpInitialize(ControlData);
            break;

        default:

            /* Unsupported */
            DPRINT1("Unknown VDM call: %lx\n", ControlCode);
            Status = STATUS_INVALID_PARAMETER;
    }

    /* Return the status */
    return Status;
}
Example #2
0
NTSTATUS
NtVdmControl(
    IN VDMSERVICECLASS Service,
    IN OUT PVOID ServiceData
)
/*++

Routine Description:

    x86 specific routine which dispatches to the appropriate function
    based on service number.

Arguments:

    Service -- Specifies what service is to be performed
    ServiceData -- Supplies a pointer to service specific data

Return Value:

    if invalid service number: STATUS_INVALID_PARAMETER_1
    else see individual services.


--*/
{
    NTSTATUS Status;

    PAGED_CODE();

    //
    //  Dispatch in descending order of frequency
    //
    if (Service == VdmStartExecution) {
        Status = VdmpStartExecution();
    } else if (Service == VdmQueueInterrupt) {
        Status = VdmpQueueInterrupt(ServiceData);
    } else if (Service == VdmDelayInterrupt) {
        Status = VdmpDelayInterrupt(ServiceData);
    } else if (Service == VdmQueryDir) {
        Status = VdmQueryDirectoryFile(ServiceData);
    } else if (Service == VdmInitialize) {
        Status = VdmpInitialize(ServiceData);
    } else if (Service == VdmFeatures) {
        try {
            //
            // Verify that we were passed a valid user address
            //
            ProbeForWriteBoolean((PBOOLEAN)ServiceData);

            //
            // Return the appropriate feature bits to notify
            // ntvdm which modes (if any) fast IF emulation is
            // available for
            //
            if (KeI386VdmIoplAllowed) {
                *((PULONG)ServiceData) = V86_VIRTUAL_INT_EXTENSIONS;
            } else {
                // remove this if pm extensions to be used
                *((PULONG)ServiceData) = KeI386VirtualIntExtensions &
                                         ~PM_VIRTUAL_INT_EXTENSIONS;
            }

        }
        except(EXCEPTION_EXECUTE_HANDLER) {
            Status = GetExceptionCode();
        }
        Status = STATUS_SUCCESS;

    } else if (Service == VdmSetInt21Handler) {