Source code of Windows XP (NT5)
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.

122 lines
3.9 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: ddhelp.c
  6. * Content: helper app to cleanup after dead processes
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 29-mar-95 craige initial implementation
  11. * 09-may-95 craige call fn in dll
  12. * 20-jul-95 craige internal reorg to prevent thunking during modeset
  13. * 29-nov-95 angusm added DDHELPREQ_CREATEDSFOCUSTHREAD
  14. * 18-jul-96 andyco added dplayhelp_xxx functions to allow > 1 dplay app to
  15. * host a game on a single machine.
  16. * 3-oct-96 andyco made the winmain crit section "cs" a global so we can take
  17. * it in dphelps receive thread before forwarding requests
  18. * 05-oct-96 colinmc fixed build breaker with CRITICAL SECTION stuff
  19. * 12-oct-96 colinmc new service to load the DirectX VXD into DDHELP
  20. * (necessary for the Win16 lock stuff)
  21. * 18-jan-97 colinmc vxd handling stuff is no longer win16 lock specific
  22. *
  23. ***************************************************************************/
  24. #ifndef __DDHELP_INCLUDED__
  25. #define __DDHELP_INCLUDED__
  26. /*
  27. * globals
  28. */
  29. #ifndef NO_D3D
  30. extern CRITICAL_SECTION cs; // the crit section we take in winmain
  31. // this is a global so dphelp can take it before
  32. // forwarding enum requests that come in on its
  33. // receive thread (manbugs 3907)
  34. #endif
  35. /*
  36. * named objects
  37. */
  38. #define DDHELP_EVENT_NAME "__DDHelpEvent__"
  39. #define DDHELP_ACK_EVENT_NAME "__DDHelpAckEvent__"
  40. #define DDHELP_STARTUP_EVENT_NAME "__DDHelpStartupEvent__"
  41. #define DDHELP_SHARED_NAME "__DDHelpShared__"
  42. #define DDHELP_MUTEX_NAME "__DDHelpMutex__"
  43. #define DDHELP_MODESET_EVENT_NAME "__DDHelpModeSetEvent%d__"
  44. #define DDHELP_DOSBOX_EVENT_NAME "__DDHelpDOSBoxSetEvent%d__"
  45. #define DDHELP_APMSUSPEND_EVENT_NAME "__DDHelpApmSuspendEvent__"
  46. #define DDHELP_APMRESUME_EVENT_NAME "__DDHelpApmResumeEvent__"
  47. /*
  48. * requests
  49. */
  50. #define DDHELPREQ_NEWPID 1
  51. #define DDHELPREQ_NEWDC 2
  52. #define DDHELPREQ_FREEDCLIST 3
  53. #define DDHELPREQ_RETURNHELPERPID 4
  54. #define DDHELPREQ_LOADDLL 5
  55. #define DDHELPREQ_FREEDLL 6
  56. #define DDHELPREQ_SUICIDE 7
  57. #define DDHELPREQ_KILLATTACHED 8
  58. #define DDHELPREQ_WAVEOPEN 9
  59. #define DDHELPREQ_WAVECLOSE 10
  60. #define DDHELPREQ_CREATETIMER 11
  61. #define DDHELPREQ_KILLTIMER 12
  62. #define DDHELPREQ_CREATEHELPERTHREAD 13
  63. #define DDHELPREQ_CREATEMODESETTHREAD 14
  64. #define DDHELPREQ_KILLMODESETTHREAD 15
  65. #define DDHELPREQ_CREATEDSMIXERTHREAD 16
  66. #define DDHELPREQ_CALLDSCLEANUP 17
  67. #define DDHELPREQ_CREATEDSFOCUSTHREAD 18
  68. #define DDHELPREQ_DPLAYADDSERVER 19
  69. #define DDHELPREQ_DPLAYDELETESERVER 20
  70. #ifdef WIN95
  71. #define DDHELPREQ_GETDSVXDHANDLE 21
  72. #endif /* WIN95 */
  73. #define DDHELPREQ_NOTIFYONDISPLAYCHANGE 22
  74. #ifdef WIN95
  75. #define DDHELPREQ_CREATEDOSBOXTHREAD 23
  76. #define DDHELPREQ_KILLDOSBOXTHREAD 24
  77. #endif /* WIN95 */
  78. #define DDHELPREQ_LOADLIBRARY 25
  79. #define DDHELPREQ_FREELIBRARY 26
  80. #define DDHELPREQ_STOPWATCHPID 27
  81. #define DDHELPREQ_ADDDEVICECHANGENOTIFY 28
  82. #define DDHELPREQ_DELDEVICECHANGENOTIFY 29
  83. #ifdef WIN95
  84. #define DDHELPREQ_GETDDVXDHANDLE 30
  85. #endif /* WIN95 */
  86. /*
  87. * callback routine
  88. */
  89. typedef BOOL (FAR PASCAL *LPHELPNOTIFYPROC)(struct DDHELPDATA *);
  90. typedef BOOL (FAR PASCAL *LPHELPMODESETNOTIFYPROC)( LPVOID lpDD );
  91. typedef void (FAR PASCAL *LPDSCLEANUP)(LPVOID pds);
  92. typedef BOOL (FAR PASCAL *LPDEVICECHANGENOTIFYPROC)(UINT, DWORD);
  93. /*
  94. * communication data
  95. */
  96. typedef struct DDHELPDATA
  97. {
  98. int req;
  99. HANDLE req_id;
  100. DWORD pid;
  101. BOOL isdisp;
  102. union
  103. {
  104. LPHELPNOTIFYPROC lpNotify;
  105. LPHELPMODESETNOTIFYPROC lpModeSetNotify;
  106. };
  107. DWORD context;
  108. char fname[260];
  109. char func[64];
  110. ULONG_PTR dwData1;
  111. ULONG_PTR dwData2;
  112. LPVOID pData1;
  113. LPVOID pData2;
  114. ULONG_PTR dwReturn;
  115. } DDHELPDATA, *LPDDHELPDATA;
  116. #endif