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.

195 lines
3.5 KiB

  1. #ifndef _EMEXTN_H
  2. #define _EMEXTN_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif // __cplusplus
  6. typedef BOOL (CALLBACK* ENUMPROCSANDSERVICES)(long, LPCTSTR, LPCTSTR, LPCTSTR, LPARAM, LONG);
  7. #define E_TOOMANY_PROCESSES -1
  8. DWORD
  9. GetNumberOfRunningApps
  10. (
  11. /* [out] */ DWORD *pdwNumbApps
  12. );
  13. DWORD
  14. GetAllPids
  15. (
  16. /* [out] */ DWORD adwProcIDs[],
  17. /* [in] */ DWORD dwBuffSize,
  18. /* [out] */ DWORD *pdwNumbProcs
  19. );
  20. DWORD
  21. GetNumberOfServices
  22. (
  23. /* [out */ DWORD *pdwNumbSrvcs,
  24. /* [in] */ DWORD dwServiceType = SERVICE_WIN32,
  25. /* [in] */ DWORD dwServiceState = SERVICE_ACTIVE
  26. );
  27. DWORD
  28. GetNumberOfActiveServices
  29. (
  30. /* [out */ DWORD *pdwNumbRunningSrvcs
  31. );
  32. DWORD
  33. GetNumberOfInactiveServices
  34. (
  35. /* [out */ DWORD *pdwNumbStoppedSrvcs
  36. );
  37. DWORD
  38. IsService
  39. (
  40. /* [in] */ UINT nPid,
  41. /* [out] */ bool *pbIsService,
  42. /* [out] */ LPTSTR lpszImagePath = NULL,
  43. /* [out] */ ULONG cchImagePath = 0L,
  44. /* [out] */ LPTSTR lpszServiceShortName = NULL,
  45. /* [in] */ ULONG cchServiceShortName = 0L,
  46. /* [out] */ LPTSTR lpszServiceDescription = NULL,
  47. /* [in] */ ULONG cchServiceDescription = 0L
  48. );
  49. DWORD
  50. IsService_NT5
  51. (
  52. /* [in] */ UINT nPid,
  53. /* [out] */ bool *pbIsService,
  54. /* [out] */ LPTSTR lpszImagePath = NULL,
  55. /* [out] */ ULONG cchImagePath = 0L,
  56. /* [out] */ LPTSTR lpszServiceShortName = NULL,
  57. /* [in] */ ULONG cchServiceShortName = 0L,
  58. /* [out] */ LPTSTR lpszServiceDescription = NULL,
  59. /* [in] */ ULONG cchServiceDescription = 0L
  60. );
  61. HRESULT
  62. IsService_NT4
  63. (
  64. IN UINT nPid,
  65. OUT bool *pbIsService
  66. );
  67. DWORD
  68. GetServiceInfo
  69. (
  70. /* [in] */ UINT nPid,
  71. /* [out] */ LPTSTR lpszImagePath,
  72. /* [out] */ ULONG cchImagePath,
  73. /* [out] */ LPTSTR lpszServiceShortName,
  74. /* [in] */ ULONG cchServiceShortName,
  75. /* [out] */ LPTSTR lpszServiceDescription,
  76. /* [in] */ ULONG cchServiceDescription
  77. );
  78. DWORD
  79. EnumRunningProcesses
  80. (
  81. /* [in] */ ENUMPROCSANDSERVICES lpEnumRunProc,
  82. /* [in] */ LPARAM lParam,
  83. /* [in] */ UINT nStartIndex = 0L
  84. );
  85. DWORD
  86. EnumRunningServices
  87. (
  88. /* [in] */ ENUMPROCSANDSERVICES lpEnumSrvcsProc,
  89. /* [in] */ LPARAM lParam,
  90. /* [in] */ UINT nStartIndex = 0L
  91. );
  92. DWORD
  93. EnumStoppedServices
  94. (
  95. /* [in] */ ENUMPROCSANDSERVICES lpEnumSrvcsProc,
  96. /* [in] */ LPARAM lParam,
  97. /* [in] */ UINT nStartIndex = 0L
  98. );
  99. DWORD
  100. EnumServices
  101. (
  102. /* [in] */ ENUMPROCSANDSERVICES lpEnumSrvcsProc,
  103. /* [in] */ LPARAM lParam,
  104. /* [in] */ DWORD dwSrvcState,
  105. /* [in] */ UINT nStartIndex = 0L
  106. );
  107. /***************************************************/
  108. BOOL
  109. IsImageRunning
  110. (
  111. /* [in] */ ULONG lPID
  112. );
  113. DWORD
  114. GetImageNameFromPID
  115. (
  116. /* [in] */ ULONG lPID,
  117. /* [out] */ LPTSTR lpszImagePath,
  118. /* [in] */ DWORD dwBuffSize
  119. );
  120. DWORD
  121. StartServiceAndGetPid
  122. (
  123. /* [in] */ LPCTSTR lpszServiceShortName,
  124. /* [out] */ UINT *pnPid
  125. );
  126. DWORD
  127. IsValidImage
  128. (
  129. /* [in] */ ULONG lPID,
  130. /* [in] */ LPCTSTR lpszImageName,
  131. /* [out] */ bool *pbValidImage
  132. );
  133. DWORD
  134. IsValidProcess
  135. (
  136. /* [in] */ ULONG lPID,
  137. /* [in] */ LPCTSTR lpszImageName,
  138. /* [out] */ bool *pbValidImage
  139. );
  140. DWORD
  141. IsValidService
  142. (
  143. /* [in] */ ULONG lPID,
  144. /* [in] */ LPCTSTR lpszImageName,
  145. /* [out] */ bool *pbValidImage
  146. );
  147. DWORD
  148. GetProcessHandle
  149. (
  150. IN ULONG lPid,
  151. OUT HANDLE *phProcess
  152. );
  153. HRESULT
  154. GetPackageDescription
  155. (
  156. /* [in] */ const long nPid,
  157. /* [out] */ BSTR &bstrDescription
  158. );
  159. BOOL
  160. IsPackage
  161. (
  162. /* [in[ */ LPTSTR lpszImageName
  163. );
  164. #ifdef __cplusplus
  165. } // extern "C"
  166. #endif
  167. #endif // _EMEXTN_H