VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuestPnP.cpp@ 30931

Last change on this file since 30931 was 30201, checked in by vboxsync, 15 years ago

Clean up balloon in pnp remove device as well

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.9 KB
Line 
1/** @file
2 *
3 * VBoxGuest -- VirtualBox Win32 guest support driver PnP code
4 *
5 * Copyright (C) 2006-2007 Oracle Corporation
6 *
7 * This file is part of VirtualBox Open Source Edition (OSE), as
8 * available from http://www.virtualbox.org. This file is free software;
9 * you can redistribute it and/or modify it under the terms of the GNU
10 * General Public License (GPL) as published by the Free Software
11 * Foundation, in version 2 as it comes in the "COPYING" file of the
12 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14 */
15
16// enable backdoor logging
17//#define LOG_ENABLED
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include "VBoxGuestPnP.h"
23#include "Helper.h"
24#include <VBox/err.h>
25
26#include <VBox/VBoxGuestLib.h>
27
28/*******************************************************************************
29* Defined Constants And Macros *
30*******************************************************************************/
31
32
33extern "C"
34{
35static NTSTATUS sendIrpSynchronously(PDEVICE_OBJECT pDevObj, PIRP pIrp, BOOLEAN fStrict);
36static NTSTATUS pnpIrpComplete(PDEVICE_OBJECT pDevObj, PIRP pIrp, PKEVENT event);
37static VOID showDeviceResources(PCM_PARTIAL_RESOURCE_LIST pResourceList);
38}
39
40#ifdef ALLOC_PRAGMA
41#pragma alloc_text (PAGE, VBoxGuestPnP)
42#pragma alloc_text (PAGE, VBoxGuestPower)
43#pragma alloc_text (PAGE, sendIrpSynchronously)
44#pragma alloc_text (PAGE, showDeviceResources)
45#endif
46
47/* reenable logging, this was #undef'ed on iprt/log.h for RING0 */
48#define LOG_ENABLED
49
50/*******************************************************************************
51* Internal Functions *
52*******************************************************************************/
53
54/**
55 * Irp completion routine for PnP Irps we send.
56 *
57 * @param pDevObj Device object.
58 * @param pIrp Request packet.
59 * @param event Semaphore.
60 * @return NT status code
61 */
62static NTSTATUS pnpIrpComplete(PDEVICE_OBJECT pDevObj, PIRP pIrp, PKEVENT event)
63{
64 KeSetEvent(event, 0, FALSE);
65 return STATUS_MORE_PROCESSING_REQUIRED;
66}
67
68/**
69 * Helper to send a PnP IRP and wait until it's done.
70 *
71 * @param pDevObj Device object.
72 * @param pIrp Request packet.
73 * @param fStrict When set, returns an error if the IRP gives an error.
74 * @return NT status code
75 */
76static NTSTATUS sendIrpSynchronously(PDEVICE_OBJECT pDevObj, PIRP pIrp, BOOLEAN fStrict)
77{
78 KEVENT event;
79
80 KeInitializeEvent(&event, SynchronizationEvent, FALSE);
81
82 IoCopyCurrentIrpStackLocationToNext(pIrp);
83 IoSetCompletionRoutine(pIrp, (PIO_COMPLETION_ROUTINE)pnpIrpComplete, &event, TRUE, TRUE, TRUE);
84
85 NTSTATUS rc = IoCallDriver(pDevObj, pIrp);
86
87 if (rc == STATUS_PENDING)
88 {
89 KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
90 rc = pIrp->IoStatus.Status;
91 }
92
93 if (!fStrict
94 && (rc == STATUS_NOT_SUPPORTED || rc == STATUS_INVALID_DEVICE_REQUEST))
95 {
96 rc = STATUS_SUCCESS;
97 }
98
99 dprintf(("VBoxGuest::sendIrpSynchronously: returning 0x%x\n", rc));
100
101 return rc;
102}
103
104
105/**
106 * PnP Request handler.
107 *
108 * @param pDevObj Device object.
109 * @param pIrp Request packet.
110 */
111NTSTATUS VBoxGuestPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp)
112{
113 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
114 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);
115 NTSTATUS rc = STATUS_SUCCESS;
116
117#ifdef LOG_ENABLED
118 static char* fcnname[] =
119 {
120 "IRP_MN_START_DEVICE",
121 "IRP_MN_QUERY_REMOVE_DEVICE",
122 "IRP_MN_REMOVE_DEVICE",
123 "IRP_MN_CANCEL_REMOVE_DEVICE",
124 "IRP_MN_STOP_DEVICE",
125 "IRP_MN_QUERY_STOP_DEVICE",
126 "IRP_MN_CANCEL_STOP_DEVICE",
127 "IRP_MN_QUERY_DEVICE_RELATIONS",
128 "IRP_MN_QUERY_INTERFACE",
129 "IRP_MN_QUERY_CAPABILITIES",
130 "IRP_MN_QUERY_RESOURCES",
131 "IRP_MN_QUERY_RESOURCE_REQUIREMENTS",
132 "IRP_MN_QUERY_DEVICE_TEXT",
133 "IRP_MN_FILTER_RESOURCE_REQUIREMENTS",
134 "",
135 "IRP_MN_READ_CONFIG",
136 "IRP_MN_WRITE_CONFIG",
137 "IRP_MN_EJECT",
138 "IRP_MN_SET_LOCK",
139 "IRP_MN_QUERY_ID",
140 "IRP_MN_QUERY_PNP_DEVICE_STATE",
141 "IRP_MN_QUERY_BUS_INFORMATION",
142 "IRP_MN_DEVICE_USAGE_NOTIFICATION",
143 "IRP_MN_SURPRISE_REMOVAL",
144 };
145 dprintf(("VBoxGuest::VBoxGuestPnp: MinorFunction: %s\n", pStack->MinorFunction < (sizeof(fcnname)/sizeof(fcnname[0])) ? fcnname[pStack->MinorFunction] : "unknown"));
146#endif
147 switch (pStack->MinorFunction)
148 {
149 case IRP_MN_START_DEVICE:
150 {
151 rc = sendIrpSynchronously(pDevExt->nextLowerDriver, pIrp, TRUE);
152
153 if (NT_SUCCESS(rc) && NT_SUCCESS(pIrp->IoStatus.Status))
154 {
155 dprintf(("VBoxGuest::START_DEVICE: pStack->Parameters.StartDevice.AllocatedResources = %p\n", pStack->Parameters.StartDevice.AllocatedResources));
156
157 if (!pStack->Parameters.StartDevice.AllocatedResources)
158 {
159 dprintf(("VBoxGuest::START_DEVICE: no resources, pDevExt = %p, nextLowerDriver = %p!!!\n", pDevExt, pDevExt? pDevExt->nextLowerDriver: NULL));
160 rc = STATUS_UNSUCCESSFUL;
161 }
162 else
163 {
164 showDeviceResources(&pStack->Parameters.StartDevice.AllocatedResources->List[0].PartialResourceList);
165
166 VBoxScanPCIResourceList(pStack->Parameters.StartDevice.AllocatedResourcesTranslated,
167 pDevExt);
168
169 /** @todo cleanup and merging codepath with NT */
170 int rcVBox;
171 rcVBox = VbglInit (pDevExt->startPortAddress, pDevExt->pVMMDevMemory);
172 if (!RT_SUCCESS(rcVBox))
173 {
174 dprintf(("VBoxGuest::START_DEVICE: VbglInit failed. rcVBox = %d\n", rcVBox));
175 rc = STATUS_UNSUCCESSFUL;
176 }
177
178 if (NT_SUCCESS(rc))
179 {
180 rcVBox = VbglGRAlloc ((VMMDevRequestHeader **)&pDevExt->irqAckEvents, sizeof (VMMDevEvents), VMMDevReq_AcknowledgeEvents);
181 if (!RT_SUCCESS(rc))
182 {
183 dprintf(("VBoxGuest::START_DEVICE: VbglAlloc failed for irqAckEvents. rcVBox = %d\n", rcVBox));
184 rc = STATUS_UNSUCCESSFUL;
185 }
186 }
187
188 if (NT_SUCCESS(rc))
189 {
190 rcVBox = VbglGRAlloc ((VMMDevRequestHeader **)&pDevExt->powerStateRequest, sizeof (VMMDevPowerStateRequest), VMMDevReq_SetPowerStatus);
191 if (!RT_SUCCESS(rc))
192 {
193 dprintf(("VBoxGuest::START_DEVICE: VbglAlloc failed for powerStateRequest. rcVBox = %d\n", rcVBox));
194 rc = STATUS_UNSUCCESSFUL;
195 }
196 }
197
198 if (NT_SUCCESS(rc))
199 {
200 // Map physical address of VMMDev memory
201 rc = hlpVBoxMapVMMDevMemory(pDevExt);
202 if (!NT_SUCCESS(rc))
203 {
204 dprintf(("VBoxGuest::START_DEVICE: can't map physical memory, rc = %d\n", rc));
205 }
206 }
207
208 if (NT_SUCCESS(rc))
209 {
210 rc = hlpVBoxReportGuestInfo (pDevExt);
211 if (!NT_SUCCESS(rc))
212 {
213 dprintf(("VBoxGuest::START_DEVICE: could not report information to host, rc = %d\n", rc));
214 }
215 }
216
217 if (NT_SUCCESS(rc))
218 {
219 // register DPC and ISR
220 dprintf(("VBoxGuest::VBoxGuestPnp: initializing DPC...\n"));
221 IoInitializeDpcRequest(pDevExt->deviceObject, VBoxGuestDpcHandler);
222
223 rc = IoConnectInterrupt(&pDevExt->interruptObject, // out: interrupt object
224 (PKSERVICE_ROUTINE)VBoxGuestIsrHandler, // ISR
225 pDevExt, // context
226 NULL, // optional spinlock
227 pDevExt->interruptVector, // interrupt vector
228 (KIRQL)pDevExt->interruptLevel, // interrupt level
229 (KIRQL)pDevExt->interruptLevel, // interrupt level
230 pDevExt->interruptMode, // LevelSensitive or Latched
231 TRUE, // shareable interrupt
232 pDevExt->interruptAffinity, // CPU affinity
233 FALSE); // don't save FPU stack
234 if (!NT_SUCCESS(rc))
235 {
236 dprintf(("VBoxGuest::VBoxGuestPnp: could not connect interrupt: rc = 0x%x\n", rc));
237 }
238 }
239 }
240 }
241 if (NT_SUCCESS(rc))
242 {
243 createThreads(pDevExt);
244
245 // initialize the event notification semaphore
246 KeInitializeEvent(&pDevExt->keventNotification, NotificationEvent, FALSE);
247
248 /* Preallocated constant timeout 250ms for HGCM async waiter. */
249 pDevExt->HGCMWaitTimeout.QuadPart = 250;
250 pDevExt->HGCMWaitTimeout.QuadPart *= -10000; /* relative in 100ns units */
251
252 VBoxInitMemBalloon(pDevExt);
253
254 // ready to rumble!
255 dprintf(("VBoxGuest::VBoxGuestPnp: device is ready!\n"));
256 pDevExt->devState = WORKING;
257 } else
258 {
259 dprintf(("VBoxGuest::VBoxGuestPnp: error: rc = 0x%x\n", rc));
260
261 // need to unmap memory in case of errors
262 hlpVBoxUnmapVMMDevMemory (pDevExt);
263 }
264 pIrp->IoStatus.Status = rc;
265 pIrp->IoStatus.Information = 0;
266 IoCompleteRequest(pIrp, IO_NO_INCREMENT);
267 break;
268 }
269
270 case IRP_MN_QUERY_REMOVE_DEVICE:
271 {
272#ifdef VBOX_REBOOT_ON_UNINSTALL
273 /* The device can not be removed without a reboot. */
274 if (pDevExt->devState == WORKING)
275 {
276 pDevExt->devState = PENDINGREMOVE;
277 }
278 pIrp->IoStatus.Status = STATUS_UNSUCCESSFUL;
279 pIrp->IoStatus.Information = 0;
280 IoCompleteRequest(pIrp, IO_NO_INCREMENT);
281 rc = STATUS_UNSUCCESSFUL;
282
283 dprintf(("VBoxGuest::VBoxGuestPnp: refuse with rc = %p\n", pIrp->IoStatus.Status));
284#else
285 pIrp->IoStatus.Status = STATUS_SUCCESS;
286 if (pDevExt->devState == WORKING)
287 {
288 pDevExt->devState = PENDINGREMOVE;
289 }
290 IoSkipCurrentIrpStackLocation(pIrp);
291 rc = IoCallDriver(pDevExt->nextLowerDriver, pIrp);
292#endif /* VBOX_REBOOT_ON_UNINSTALL */
293 break;
294 }
295
296 case IRP_MN_REMOVE_DEVICE:
297 {
298 /* @todo merge Remove and Stop, make a helper for common actions */
299 pIrp->IoStatus.Status = STATUS_SUCCESS;
300
301 unreserveHypervisorMemory(pDevExt);
302
303 if (pDevExt->workerThread)
304 {
305 dprintf(("VBoxGuest::VBoxGuestPnp: waiting for the worker thread to terminate...\n"));
306 pDevExt->stopThread = TRUE;
307 KeSetEvent(&pDevExt->workerThreadRequest, 0, FALSE);
308 KeWaitForSingleObject(pDevExt->workerThread,
309 Executive, KernelMode, FALSE, NULL);
310 dprintf(("VBoxGuest::VBoxGuestPnp: returned from KeWaitForSingleObject for worker thread\n"));
311 }
312
313 if (pDevExt->idleThread)
314 {
315 dprintf(("VBoxGuest::VBoxGuestPnp: waiting for the idle thread to terminate...\n"));
316 pDevExt->stopThread = TRUE;
317 KeWaitForSingleObject(pDevExt->idleThread,
318 Executive, KernelMode, FALSE, NULL);
319 dprintf(("VBoxGuest::VBoxGuestPnp: returned from KeWaitForSingleObject for idle thread\n"));
320 }
321
322 VbglTerminate ();
323
324 // according to MSDN we have to unmap previously mapped memory
325 hlpVBoxUnmapVMMDevMemory (pDevExt);
326
327 /* Free the memory balloon (if any) */
328 VBoxCleanupMemBalloon(pDevExt);
329
330 if (pDevExt->nextLowerDriver != NULL)
331 {
332 IoDetachDevice(pDevExt->nextLowerDriver);
333 }
334
335#ifdef VBOX_WITH_HGCM
336 if (pDevExt->SessionSpinlock != NIL_RTSPINLOCK)
337 RTSpinlockDestroy(pDevExt->SessionSpinlock);
338#endif
339
340 UNICODE_STRING win32Name;
341 RtlInitUnicodeString(&win32Name, VBOXGUEST_DEVICE_NAME_DOS);
342 IoDeleteSymbolicLink(&win32Name);
343 IoDeleteDevice(pDevObj);
344 pDevExt->devState = REMOVED;
345 IoSkipCurrentIrpStackLocation(pIrp);
346 rc = IoCallDriver(pDevExt->nextLowerDriver, pIrp);
347 break;
348 }
349
350 case IRP_MN_QUERY_STOP_DEVICE:
351 {
352#ifdef VBOX_REBOOT_ON_UNINSTALL
353 dprintf(("VBoxGuest::VBoxGuestPnp: refuse\n"));
354 /* The device can not be stopped without a reboot. */
355 if (pDevExt->devState == WORKING)
356 {
357 pDevExt->devState = PENDINGSTOP;
358 }
359 pIrp->IoStatus.Status = STATUS_UNSUCCESSFUL;
360 IoCompleteRequest(pIrp, IO_NO_INCREMENT);
361 rc = STATUS_UNSUCCESSFUL;
362#else
363 pIrp->IoStatus.Status = STATUS_SUCCESS;
364 if (pDevExt->devState == WORKING)
365 {
366 pDevExt->devState = PENDINGSTOP;
367 }
368 IoSkipCurrentIrpStackLocation(pIrp);
369 rc = IoCallDriver(pDevExt->nextLowerDriver, pIrp);
370#endif /* VBOX_REBOOT_ON_UNINSTALL */
371 break;
372 }
373
374 case IRP_MN_STOP_DEVICE:
375 {
376 pIrp->IoStatus.Status = STATUS_SUCCESS;
377 if (pDevExt->devState == PENDINGSTOP)
378 {
379 VbglTerminate ();
380
381 // according to MSDN we have to unmap previously mapped memory
382 hlpVBoxUnmapVMMDevMemory (pDevExt);
383
384 pDevExt->devState = STOPPED;
385 dprintf(("VBoxGuest::VBoxGuestPnp: device has been disabled\n"));
386 } else
387 {
388 dprintf(("VBoxGuest::VBoxGuestPnp: devState not PENDINGSTOP but %d\n", pDevExt->devState));
389 }
390 IoSkipCurrentIrpStackLocation(pIrp);
391 rc = IoCallDriver(pDevExt->nextLowerDriver, pIrp);
392 break;
393 }
394
395 default:
396 {
397 IoSkipCurrentIrpStackLocation(pIrp);
398 rc = IoCallDriver(pDevExt->nextLowerDriver, pIrp);
399 }
400
401 }
402 return rc;
403}
404
405
406/**
407 * Debug helper to dump a device resource list.
408 *
409 * @param pResourceList list of device resources.
410 */
411static VOID showDeviceResources(PCM_PARTIAL_RESOURCE_LIST pResourceList)
412{
413#ifdef LOG_ENABLED
414 PCM_PARTIAL_RESOURCE_DESCRIPTOR resource = pResourceList->PartialDescriptors;
415 ULONG nres = pResourceList->Count;
416 ULONG i;
417
418 for (i = 0; i < nres; ++i, ++resource)
419 {
420 ULONG type = resource->Type;
421
422 static char* name[] =
423 {
424 "CmResourceTypeNull",
425 "CmResourceTypePort",
426 "CmResourceTypeInterrupt",
427 "CmResourceTypeMemory",
428 "CmResourceTypeDma",
429 "CmResourceTypeDeviceSpecific",
430 "CmResourceTypeBusNumber",
431 "CmResourceTypeDevicePrivate",
432 "CmResourceTypeAssignedResource",
433 "CmResourceTypeSubAllocateFrom",
434 };
435
436 dprintf(("VBoxGuest::showDeviceResources: type %s", type < (sizeof(name)/sizeof(name[0])) ? name[type] : "unknown"));
437
438 switch (type)
439 {
440 case CmResourceTypePort:
441 case CmResourceTypeMemory:
442 dprintf(("VBoxGuest::showDeviceResources: start %8X%8.8lX length %X\n",
443 resource->u.Port.Start.HighPart, resource->u.Port.Start.LowPart,
444 resource->u.Port.Length));
445 break;
446
447 case CmResourceTypeInterrupt:
448 dprintf(("VBoxGuest::showDeviceResources: level %X, vector %X, affinity %X\n",
449 resource->u.Interrupt.Level, resource->u.Interrupt.Vector,
450 resource->u.Interrupt.Affinity));
451 break;
452
453 case CmResourceTypeDma:
454 dprintf(("VBoxGuest::showDeviceResources: channel %d, port %X\n",
455 resource->u.Dma.Channel, resource->u.Dma.Port));
456 break;
457
458 default:
459 dprintf(("\n"));
460 break;
461 }
462 }
463#endif
464}
465
466/**
467 * Handle the power completion event.
468 *
469 * @returns NT status code
470 * @param devObj targetted device object
471 * @param irp IO request packet
472 * @param context context value passed to IoSetCompletionRoutine in VBoxGuestPower
473 */
474NTSTATUS VBoxGuestPowerComplete(IN PDEVICE_OBJECT devObj,
475 IN PIRP irp, IN PVOID context)
476{
477 PIO_STACK_LOCATION irpSp;
478 PVBOXGUESTDEVEXT devExt = (PVBOXGUESTDEVEXT)context;
479
480 ASSERT(devExt);
481 ASSERT(devExt->signature == DEVICE_EXTENSION_SIGNATURE);
482
483 irpSp = IoGetCurrentIrpStackLocation(irp);
484 ASSERT(irpSp->MajorFunction == IRP_MJ_POWER);
485
486 if (NT_SUCCESS(irp->IoStatus.Status))
487 {
488 switch (irpSp->MinorFunction)
489 {
490 case IRP_MN_SET_POWER:
491
492 switch (irpSp->Parameters.Power.Type)
493 {
494 case DevicePowerState:
495 switch (irpSp->Parameters.Power.State.DeviceState)
496 {
497 case PowerDeviceD0:
498 break;
499 }
500 break;
501 }
502 break;
503 }
504 }
505
506 return STATUS_SUCCESS;
507}
508
509
510/**
511 * Handle the Power requests.
512 *
513 * @returns NT status code
514 * @param pDevObj device object
515 * @param pIrp IRP
516 */
517NTSTATUS VBoxGuestPower(PDEVICE_OBJECT pDevObj, PIRP pIrp)
518{
519 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);
520 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;
521 POWER_STATE_TYPE powerType;
522 POWER_STATE powerState;
523 POWER_ACTION powerAction;
524
525 dprintf(("VBoxGuest::VBoxGuestPower\n"));
526
527 powerType = pStack->Parameters.Power.Type;
528 powerAction = pStack->Parameters.Power.ShutdownType;
529 powerState = pStack->Parameters.Power.State;
530
531 switch (pStack->MinorFunction)
532 {
533 case IRP_MN_SET_POWER:
534 {
535 dprintf(("VBoxGuest::VBoxGuestPower: IRP_MN_SET_POWER\n"));
536 switch (powerType)
537 {
538 case SystemPowerState:
539 {
540 dprintf(("VBoxGuest::VBoxGuestPower: SystemPowerState\n"));
541 switch (powerAction)
542 {
543 case PowerActionShutdownReset:
544 {
545 dprintf(("VBoxGuest::VBoxGuestPower: power action reset!\n"));
546 /* tell the VMM that we no longer support mouse pointer integration */
547
548 VMMDevReqMouseStatus *req = NULL;
549
550 int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqMouseStatus), VMMDevReq_SetMouseStatus);
551
552 if (RT_SUCCESS(rc))
553 {
554 req->mouseFeatures = 0;
555 req->pointerXPos = 0;
556 req->pointerYPos = 0;
557
558 rc = VbglGRPerform (&req->header);
559
560 if (RT_FAILURE(rc))
561 {
562 dprintf(("VBoxGuest::PowerStateRequest: error communicating new power status to VMMDev. "
563 "rc = %Rrc\n", rc));
564 }
565
566 VbglGRFree (&req->header);
567 }
568 break;
569 }
570
571 case PowerActionShutdown:
572 case PowerActionShutdownOff:
573 {
574 dprintf(("VBoxGuest::VBoxGuestPower: power action shutdown!\n"));
575 if (powerState.SystemState >= PowerSystemShutdown)
576 {
577 dprintf(("VBoxGuest::VBoxGuestPower: Telling the VMMDev to close the VM...\n"));
578
579 if (pDevExt && pDevExt->powerStateRequest)
580 {
581 VMMDevPowerStateRequest *req = pDevExt->powerStateRequest;
582
583 req->header.requestType = VMMDevReq_SetPowerStatus;
584 req->powerState = VMMDevPowerState_PowerOff;
585
586 int rc = VbglGRPerform (&req->header);
587
588 if (RT_FAILURE(rc))
589 {
590 dprintf(("VBoxGuest::PowerStateRequest: error communicating new power status to VMMDev. "
591 "rc = %Rrc\n", rc));
592 }
593 }
594 }
595 break;
596 }
597 }
598 break;
599 }
600 default:
601 break;
602 }
603 break;
604 }
605 default:
606 break;
607 }
608
609 /*
610 * Whether we are completing or relaying this power IRP,
611 * we must call PoStartNextPowerIrp.
612 */
613 PoStartNextPowerIrp(pIrp);
614
615 /*
616 * Send the IRP down the driver stack,
617 * using PoCallDriver (not IoCallDriver, as for non-power irps).
618 */
619 IoCopyCurrentIrpStackLocationToNext(pIrp);
620 IoSetCompletionRoutine(pIrp,
621 VBoxGuestPowerComplete,
622 (PVOID)pDevExt,
623 TRUE,
624 TRUE,
625 TRUE);
626 return PoCallDriver(pDevExt->nextLowerDriver, pIrp);
627}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette