Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. physdesc.c
  5. Abstract
  6. Get-friendly-name handling routines
  7. Author:
  8. Ervin P.
  9. Environment:
  10. Kernel mode only
  11. Revision History:
  12. --*/
  13. #include "pch.h"
  14. /*
  15. ********************************************************************************
  16. * HidpGetPhysicalDescriptor
  17. ********************************************************************************
  18. *
  19. * Note: This function cannot be pageable because it is called
  20. * from the IOCTL dispatch routine, which can get called
  21. * at DISPATCH_LEVEL.
  22. *
  23. */
  24. NTSTATUS HidpGetPhysicalDescriptor(IN PHIDCLASS_DEVICE_EXTENSION HidDeviceExtension, IN OUT PIRP Irp)
  25. {
  26. FDO_EXTENSION *fdoExt;
  27. NTSTATUS status;
  28. PIO_STACK_LOCATION currentIrpSp, nextIrpSp;
  29. ASSERT(HidDeviceExtension->isClientPdo);
  30. fdoExt = &HidDeviceExtension->pdoExt.deviceFdoExt->fdoExt;
  31. /*
  32. * IOCTL_GET_PHYSICAL_DESCRIPTOR uses buffering method
  33. * METHOD_OUT_DIRECT, meaning that the buffer is in
  34. * the MDL specified by Irp->MdlAddress. We'll just
  35. * pass this down and let the lower driver extract the
  36. * system address.
  37. */
  38. currentIrpSp = IoGetCurrentIrpStackLocation(Irp);
  39. nextIrpSp = IoGetNextIrpStackLocation(Irp);
  40. nextIrpSp->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
  41. nextIrpSp->Parameters.DeviceIoControl.IoControlCode = IOCTL_GET_PHYSICAL_DESCRIPTOR;
  42. nextIrpSp->Parameters.DeviceIoControl.OutputBufferLength = currentIrpSp->Parameters.DeviceIoControl.OutputBufferLength;
  43. status = HidpCallDriver(fdoExt->fdo, Irp);
  44. DBGSUCCESS(status, FALSE)
  45. return status;
  46. }