VBoxGuest-win-pnp.cpp revision eb4f1fa4c357485330370c0eaba27e5a2af7d9c4
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * VBoxGuest-win-pnp - Windows Plug'n'Play specifics.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * Copyright (C) 2010 Oracle Corporation
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * available from http://www.virtualbox.org. This file is free software;
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * you can redistribute it and/or modify it under the terms of the GNU
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * General Public License (GPL) as published by the Free Software
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/*******************************************************************************
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync* Header Files *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync*******************************************************************************/
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/*******************************************************************************
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync* Defined Constants And Macros *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync*******************************************************************************/
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsyncstatic NTSTATUS vboxguestwinSendIrpSynchronously(PDEVICE_OBJECT pDevObj, PIRP pIrp, BOOLEAN fStrict);
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsyncstatic NTSTATUS vboxguestwinPnPIrpComplete(PDEVICE_OBJECT pDevObj, PIRP pIrp, PKEVENT pEvent);
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsyncstatic VOID vboxguestwinShowDeviceResources(PCM_PARTIAL_RESOURCE_LIST pResourceList);
85fc7dbf8f928aea2a6fddde85a77950f69284ddvboxsync#pragma alloc_text (PAGE, vboxguestwinSendIrpSynchronously)
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync#pragma alloc_text (PAGE, vboxguestwinShowDeviceResources)
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/* Reenable logging, this was #undef'ed on iprt/log.h for RING0. */
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/*******************************************************************************
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync* Internal Functions *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync*******************************************************************************/
return STATUS_MORE_PROCESSING_REQUIRED;
static NTSTATUS vboxguestwinSendIrpSynchronously(PDEVICE_OBJECT pDevObj, PIRP pIrp, BOOLEAN fStrict)
if (!fStrict
return rc;
#ifdef LOG_ENABLED
static char* aszFnctName[] =
case IRP_MN_START_DEVICE:
Log(("VBoxGuest::vboxguestwinVBoxGuestPnP: START_DEVICE: pStack->Parameters.StartDevice.AllocatedResources = %p\n",
Log(("VBoxGuest::vboxguestwinVBoxGuestPnP: START_DEVICE: No resources, pDevExt = %p, nextLowerDriver = %p!\n",
#ifdef VBOX_REBOOT_ON_UNINSTALL
Log(("VBoxGuest::vboxguestwinGuestPnp: QUERY_REMOVE_DEVICE: Device cannot be removed without a reboot!\n"));
case IRP_MN_REMOVE_DEVICE:
case IRP_MN_QUERY_STOP_DEVICE:
#ifdef VBOX_REBOOT_ON_UNINSTALL
case IRP_MN_STOP_DEVICE:
return rc;
return rc;
if (pIrpSp)
case IRP_MN_SET_POWER:
case DevicePowerState:
case PowerDeviceD0:
return STATUS_SUCCESS;
case IRP_MN_SET_POWER:
switch (powerType)
case SystemPowerState:
Log(("VBoxGuest::vboxguestwinGuestPower: SystemPowerState, action = %d, state = %d\n", powerAction, powerState));
switch (powerAction)
case PowerActionSleep:
if ( pDevExt
case PowerActionShutdownReset:
int vrc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof (VMMDevReqMouseStatus), VMMDevReq_SetMouseStatus);
case PowerActionShutdown:
case PowerActionShutdownOff:
if (pReq)
case PowerActionHibernate:
if (pDevExt)
TRUE,
TRUE,
TRUE);