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.

245 lines
5.5 KiB

  1. //
  2. // Application Loader
  3. //
  4. #ifndef _H_AL
  5. #define _H_AL
  6. //
  7. //
  8. // Includes
  9. //
  10. //
  11. #include <om.h>
  12. //
  13. // THERE IS ONLY ONE CLIENT OF THE APP-LOADER: OLD WHITEBOARD
  14. //
  15. #define AL_RETRY_DELAY 100
  16. #define AL_NEW_CALL_RETRY_COUNT 5
  17. //
  18. // Result codes passed in ALS_LOAD_RESULT events
  19. //
  20. typedef enum
  21. {
  22. AL_LOAD_SUCCESS = 0,
  23. AL_LOAD_FAIL_NO_FP,
  24. AL_LOAD_FAIL_NO_EXE,
  25. AL_LOAD_FAIL_BAD_EXE,
  26. AL_LOAD_FAIL_LOW_MEM
  27. }
  28. AL_LOAD_RESULT;
  29. //
  30. //
  31. // Application Loader OBMAN object used to communicate result of attempted
  32. // loads
  33. //
  34. // szFunctionProfile : Function Profile being loaded
  35. // personName : Name of site that attempted the load
  36. // result : Result of attempted load
  37. //
  38. // NET PROTOCOL. All network raw data structures, which CAN NOT CHANGE,
  39. // are prefixed with TSHR_.
  40. //
  41. typedef struct tagTSHR_AL_LOAD_RESULT
  42. {
  43. char szFunctionProfile[OM_MAX_FP_NAME_LEN];
  44. char personName[TSHR_MAX_PERSON_NAME_LEN];
  45. TSHR_UINT16 result;
  46. TSHR_UINT16 pad;
  47. }
  48. TSHR_AL_LOAD_RESULT;
  49. typedef TSHR_AL_LOAD_RESULT * PTSHR_AL_LOAD_RESULT;
  50. typedef struct tagAL_PRIMARY
  51. {
  52. STRUCTURE_STAMP
  53. PUT_CLIENT putTask;
  54. POM_CLIENT pomClient;
  55. PCM_CLIENT pcmClient;
  56. BOOL eventProcRegistered:1;
  57. BOOL exitProcRegistered:1;
  58. BOOL inCall:1;
  59. BOOL alWorksetOpen:1;
  60. BOOL alWBRegPend:1;
  61. BOOL alWBRegSuccess:1;
  62. // Call Info
  63. UINT callID;
  64. OM_CORRELATOR omWSGCorrelator;
  65. OM_CORRELATOR omWSCorrelator;
  66. NET_UID omUID;
  67. OM_WSGROUP_HANDLE omWSGroupHandle;
  68. OM_WSGROUP_HANDLE alWSGroupHandle;
  69. // Whiteboard Client
  70. PUT_CLIENT putWB;
  71. }
  72. AL_PRIMARY;
  73. typedef struct tagAL_PRIMARY * PAL_PRIMARY;
  74. __inline void ValidateALP(PAL_PRIMARY palPrimary)
  75. {
  76. ASSERT(!IsBadWritePtr(palPrimary, sizeof(AL_PRIMARY)));
  77. }
  78. //
  79. //
  80. // Application Loader Events
  81. //
  82. // Note: these events are defined relative to AL_BASE_EVENT and use the
  83. // range AL_BASE_EVENT to AL_BASE_EVENT + 0x7F. The application
  84. // loader internally uses events in the range AL_BASE_EVENT+0x80 to
  85. // AL_BASE_EVENT+0xFF, so events in this range must not be defined
  86. // as part of the API.
  87. //
  88. //
  89. enum
  90. {
  91. ALS_LOCAL_LOAD = AL_BASE_EVENT,
  92. ALS_REMOTE_LOAD_RESULT,
  93. AL_INT_RETRY_NEW_CALL,
  94. AL_INT_STARTSTOP_WB
  95. };
  96. //
  97. // ALS_LOAD_RESULT
  98. //
  99. // Overview:
  100. //
  101. // This event informs a task of the result of an attempted load on a
  102. // remote machine.
  103. //
  104. // Parameters:
  105. //
  106. // param_1 : AL_LOAD_RESULT reasonCode;
  107. // param_2 : UINT alPersonHandle;
  108. //
  109. // reasonCode : Result of attempt to load application
  110. //
  111. // alPersonHandle : Handle for the site that attempted the load
  112. // (pass to ALS_GetPersonData() to get site name)
  113. //
  114. // Issued to:
  115. //
  116. // Applications that have registered a function profile that has been
  117. // used by the Application Loader on a remote site.
  118. //
  119. // Circumstances when issued:
  120. //
  121. // When the Application Loader on a remote site attempts to load an
  122. // application due to a new Function Profile object being added to a
  123. // call.
  124. //
  125. // Receivers response:
  126. //
  127. // None
  128. //
  129. //
  130. //
  131. // AL_RETRY_NEW_CALL
  132. //
  133. // If AL fails to register with ObManControl on receipt of a CMS_NEW_CALL,
  134. // it will in certain circumstances retry the registration after a short
  135. // delay. This is implemented by posting an AL_RETRY_NEW_CALL event back
  136. // to itself.
  137. //
  138. //
  139. // AL_INT_STARTSTOP_WB
  140. //
  141. // This starts/stops the old Whiteboard, which is now an MFC dll in CONF's
  142. // process that creates/terminates a thread. By having CONF itself start
  143. // old WB through us, autolaunch and normal launch are synchronized.
  144. //
  145. // TEMP HACK:
  146. // param1 == TRUE or FALSE (TRUE for new WB TEMP HACK!, FALSE for normal old WB)
  147. // param2 == memory block (receiver must free) of file name to open
  148. //
  149. //
  150. // PRIMARY functions
  151. //
  152. //
  153. // ALP_Init()
  154. // ALP_Term()
  155. //
  156. BOOL ALP_Init(BOOL * pfCleanup);
  157. void ALP_Term(void);
  158. BOOL CALLBACK ALPEventProc(LPVOID palPrimary, UINT event, UINT_PTR param1, UINT_PTR param2);
  159. void CALLBACK ALPExitProc(LPVOID palPrimary);
  160. void ALEndCall(PAL_PRIMARY palPrimary, UINT callID);
  161. void ALNewCall(PAL_PRIMARY palPrimary, UINT retryCount, UINT callID);
  162. BOOL ALWorksetNewInd(PAL_PRIMARY palPrimary, OM_WSGROUP_HANDLE hWSGroup, OM_WORKSET_ID worksetID);
  163. BOOL ALNewWorksetGroup(PAL_PRIMARY palPrimary, OM_WSGROUP_HANDLE hWSGroup, POM_OBJECT pObj);
  164. void ALWorksetRegisterCon(PAL_PRIMARY palPrimary, UINT correlator,
  165. UINT result, OM_WSGROUP_HANDLE hWSGroup);
  166. BOOL ALRemoteLoadResult(PAL_PRIMARY palPrimary, OM_WSGROUP_HANDLE hWSGroup,
  167. POM_OBJECT alObjHandle);
  168. void ALLocalLoadResult(PAL_PRIMARY palPrimary, BOOL success);
  169. //
  170. // SECONDARY functions
  171. //
  172. void CALLBACK ALSExitProc(LPVOID palClient);
  173. //
  174. // Launching/activation of WB
  175. // TEMP HACK FOR NEW WB!
  176. //
  177. BOOL ALStartStopWB(PAL_PRIMARY palPrimary, LPCTSTR szFile);
  178. DWORD WINAPI OldWBThreadProc(LPVOID lpv);
  179. //
  180. // Start, Run, Cleanup routines
  181. //
  182. typedef BOOL (WINAPI * PFNINITWB)(void);
  183. typedef void (WINAPI * PFNRUNWB)(void);
  184. typedef void (WINAPI * PFNTERMWB)(void);
  185. #endif // _H_AL
  186.