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.

125 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. wdm.c
  5. Abstract:
  6. This is the WDM DX mapper driver.
  7. Author:
  8. billpa
  9. Environment:
  10. Kernel mode only
  11. Revision History:
  12. --*/
  13. #include "wdm.h"
  14. #include "dxapi.h"
  15. #include "dxmapper.h"
  16. #ifdef ALLOC_PRAGMA
  17. #pragma alloc_text(PAGE, DriverEntry)
  18. #endif
  19. BOOLEAN DsoundOk = FALSE;
  20. NTSTATUS
  21. DriverEntry(
  22. IN PDRIVER_OBJECT DriverObject,
  23. IN PUNICODE_STRING RegistryPath
  24. )
  25. /*++
  26. Routine Description:
  27. Entry point for explicitely loaded stream class.
  28. Arguments:
  29. DriverObject - Pointer to the driver object created by the system.
  30. RegistryPath - unused.
  31. Return Value:
  32. STATUS_SUCCESS
  33. --*/
  34. {
  35. UNREFERENCED_PARAMETER(DriverObject);
  36. return STATUS_SUCCESS;
  37. }
  38. ULONG
  39. DxApiGetVersion(
  40. )
  41. /*++
  42. Routine Description:
  43. Arguments:
  44. Return Value:
  45. --*/
  46. {
  47. return (DXCheckDDrawVersion());
  48. }
  49. ULONG
  50. DxApi(
  51. IN ULONG dwFunctionNum,
  52. IN PVOID lpvInBuffer,
  53. IN ULONG cbInBuffer,
  54. IN PVOID lpvOutBuffer,
  55. IN ULONG cbOutBuffer
  56. )
  57. /*++
  58. Routine Description:
  59. Arguments:
  60. Return Value:
  61. --*/
  62. {
  63. //
  64. // if we haven't checked if DSOUND is present and the right version,
  65. // (or if we've checked before and failed) check and return error if not
  66. // loaded or correct version.
  67. //
  68. if (!DsoundOk) {
  69. if (DXCheckDDrawVersion() < DXVERSION) {
  70. return 0;
  71. } else {
  72. DsoundOk = TRUE;
  73. }
  74. }
  75. return DXIssueIoctl( dwFunctionNum, lpvInBuffer, cbInBuffer,
  76. lpvOutBuffer, cbOutBuffer );
  77. }