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.

91 lines
2.4 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: mmdd.c
  6. * Content: DDRAW.DLL initialization for MMOSA/Native platforms
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 15-may-95 scottle created it
  11. *
  12. ***************************************************************************/
  13. #ifdef MMOSA
  14. #include <ddrawpr.h>
  15. #include "mmdd.h"
  16. BOOL bGraphicsInit = FALSE;
  17. PIFILE pDisplay = NULL;
  18. ///////////////////////////////////////////////////////////////////////
  19. //
  20. // MMOSA_Driver_Attach() - Called during DDraw.DLL load on
  21. // a MMOSA/Native platform.
  22. // Performs MMOSA/Native device driver specific initialization
  23. //
  24. ///////////////////////////////////////////////////////////////////////
  25. BOOL MMOSA_Driver_Attach(void)
  26. {
  27. // During the DLL attach...
  28. PINAMESPACE pIName;
  29. PIUNKNOWN pUnk;
  30. SCODE Sc;
  31. // Create/Register/Bind the "display" namespace object to this process
  32. pIName = CurrentNameSpace();
  33. Sc = pIName->v->Bind( pIName, TEXT("display"), F_READ|F_WRITE, &pUnk);
  34. if (FAILED(Sc))
  35. {
  36. DPF(1, "Could not open display device (%x)\n", Sc);
  37. return FALSE;
  38. }
  39. // Get a pointer to the IFile driver interface object, we'll use it
  40. // for our display device interface.
  41. Sc = pUnk->v->QueryInterface(pUnk,&IID_IFile,(void **)&pDisplay);
  42. pUnk->v->Release(pUnk);
  43. if (FAILED(Sc))
  44. {
  45. DPF(2, "Bogus display device (%x)\n", Sc);
  46. return FALSE;
  47. }
  48. bGraphicsInit = TRUE;
  49. return TRUE;
  50. } // End MMOSA_Driver_Attach
  51. ///////////////////////////////////////////////////////////////////////
  52. //
  53. // MMOSA_Driver_Detach() - Called during DDraw.DLL unload on
  54. // a MMOSA/Native platform.
  55. // Performs MMOSA/Native device driver specific deinitialization
  56. //
  57. ///////////////////////////////////////////////////////////////////////
  58. BOOL MMOSA_Driver_Detach(void)
  59. {
  60. ///////////////////////
  61. // During the detach...
  62. ///////////////////////
  63. // Shutdown the graphics
  64. if (bGraphicsInit)
  65. {
  66. (void) pDisplay->v->SetSize( pDisplay, (UINT64) 3);
  67. pDisplay->v->Release(pDisplay);
  68. pDisplay = NULL;
  69. bGraphicsInit = FALSE;
  70. }
  71. return TRUE;
  72. } // End MMOSA_Driver_Attach
  73. int MMOSA_DDHal_Escape( HDC hdc, int nEscape, int cbInput, LPCTSTR lpszInData, int cbOutput, LPTSTR lpszOutData)
  74. {
  75. return 0;
  76. }
  77. #endif