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.

587 lines
11 KiB

  1. =head1 NAME
  2. PerlEz - PerlEz host DLL
  3. =head1 DESCRIPTION
  4. This document attempts to describe the functions of the PerlEz host Dynamically
  5. Linked Library (DLL). Please refer any questions or comments to the author below.
  6. =head2 Datatypes
  7. PerlEz has one specific data type, PERLEZHANDLE; this is a non-zero handle to
  8. a Perl interpreter that is created and can be accessed by the routines described below.
  9. =head2 PerlEzCreate
  10. =over
  11. PERLEZHANDLE PerlEzCreate(LPCSTR lpFileName, LPCSTR lpOptions);
  12. =item DESCRIPTION:
  13. =item *
  14. Creates a Perl interpreter. The return value is required parameter for all subsequent �PerlEz� calls.
  15. Multiple interpreters can be created, but only one will be executing at a time.
  16. =item PARAMS:
  17. =item *
  18. lpFileName a pointer to a ASCIIZ string that is the name of a file; can be NULL
  19. =item *
  20. lpOptions a pointer to a ASCIIZ string that are the command line options that
  21. will be provided before the script; can be NULL. This parameter is used for setting @INC or debugging.
  22. =item RETURNS:
  23. =item *
  24. A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
  25. See also L</PerlEzDelete> L</PerlEzCreateOpt>
  26. =back
  27. =head2 PerlEzCreateOpt
  28. =over
  29. PERLEZHANDLE PerlEzCreateOpt(LPCSTR lpFileName, LPCSTR lpOptions, LPCSTR lpScriptOpts);
  30. =item DESCRIPTION:
  31. =item *
  32. Creates a Perl interpreter. The return value is required parameter for all subsequent �PerlEz� calls.
  33. Multiple interpreters can be created, but only one will be executing at a time.
  34. =item PARAMS:
  35. =item *
  36. lpFileName a pointer to a ASCIIZ string that is the name of a file; can be NULL
  37. =item *
  38. lpOptions a pointer to a ASCIIZ string that are the command line options that
  39. will be provided before the script; can be NULL. This parameter is used for setting @INC or debugging.
  40. =item *
  41. lpScriptOpts a pointer to a ASCIIZ string that are the command line options that
  42. will be provided as parameters to the script; can be NULL.
  43. =item RETURNS:
  44. =item *
  45. A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
  46. See also L</PerlEzDelete> L</PerlEzCreate>
  47. =back
  48. =head2 PerlEzDelete
  49. =over
  50. BOOL PerlEzDelete(PERLEZHANDLE hHandle);
  51. =item DESCRIPTION:
  52. =item *
  53. Deletes a previously created Perl interpreter. Releases all resources allocated by PerlEzCreate or PerlEzCreateOpt.
  54. =item PARAMS:
  55. =item *
  56. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  57. =item RETURNS:
  58. =item *
  59. True if no error false otherwise.
  60. =back
  61. =head2 PerlEzEvalString
  62. =over
  63. int PerlEzEvalString(PERLEZHANDLE hHandle, LPCSTR lpString, LPSTR lpBuffer, DWORD dwBufSize);
  64. =item DESCRIPTION:
  65. =item *
  66. Evaluates the string a returns the result in lpBuffer. If there is an error $! is returned in lpBuffer.
  67. =item PARAMS:
  68. =item *
  69. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  70. =item *
  71. lpString a pointer to the ASCIIZ string to evaluate
  72. =item *
  73. lpBuffer a pointer to the buffer where the result will be placed
  74. =item *
  75. dwBufSize the size in bytes of the space where lpBuffer points
  76. =item RETURNS:
  77. =item *
  78. A zero if no error; otherwise error code. See L</"Error Codes">
  79. =back
  80. =head2 PerlEzCall1
  81. =over
  82. int PerlEzCall1(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, LPVOID lpVoid);
  83. =item DESCRIPTION:
  84. =item *
  85. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  86. =item PARAMS:
  87. =item *
  88. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  89. =item *
  90. lpFunction a pointer name of the function to call
  91. =item *
  92. lpBuffer a pointer to the buffer where the result will be placed
  93. =item *
  94. dwBufSize the size in bytes of the space where lpBuffer points
  95. =item *
  96. lpFormat a pointer to the parameter specifier; can be NULL. See L</"Format String">
  97. =item *
  98. lpVoid a pointer to a parameter will be interpreted based on lpFormat
  99. =item RETURNS:
  100. =item *
  101. A zero if no error; otherwise error code. See L</"Error Codes">
  102. =back
  103. =head2 PerlEzCall2
  104. =over
  105. int PerlEzCall2(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  106. LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2);
  107. =item DESCRIPTION:
  108. =item *
  109. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  110. =item PARAMS:
  111. =item *
  112. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  113. =item *
  114. lpFunction a pointer name of the function to call
  115. =item *
  116. lpBuffer a pointer to the buffer where the result will be placed
  117. =item *
  118. dwBufSize the size in bytes of the space where lpBuffer points
  119. =item *
  120. lpFormat a pointer to the parameter specifier; can be NULL. See L</"Format String">
  121. =item *
  122. lpVoid1...2 pointers to parameters that will be interpreted based on lpFormat
  123. =item RETURNS:
  124. =item *
  125. A zero if no error; otherwise error code. See L</"Error Codes">
  126. =back
  127. =head2 PerlEzCall4
  128. =over
  129. int PerlEzCall4(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  130. LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4);
  131. =item DESCRIPTION:
  132. =item *
  133. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  134. =item PARAMS:
  135. =item *
  136. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  137. =item *
  138. lpFunction a pointer name of the function to call
  139. =item *
  140. lpBuffer a pointer to the buffer where the result will be placed
  141. =item *
  142. dwBufSize the size in bytes of the space where lpBuffer points
  143. =item *
  144. lpFormat a pointer to the parameter specifier; can be NULL. See L</"Format String">
  145. =item *
  146. lpVoid1...4 pointers to parameters that will be interpreted based on lpFormat
  147. =item RETURNS:
  148. =item *
  149. A zero if no error; otherwise error code. See L</"Error Codes">
  150. =back
  151. =head2 PerlEzCall8
  152. =over
  153. int PerlEzCall8(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  154. LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4, LPVOID lpVoid5,
  155. LPVOID lpVoid6, LPVOID lpVoid7, LPVOID lpVoid8);
  156. =item DESCRIPTION:
  157. =item *
  158. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  159. =item PARAMS:
  160. =item *
  161. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  162. =item *
  163. lpFunction a pointer name of the function to call
  164. =item *
  165. lpBuffer a pointer to the buffer where the result will be placed
  166. =item *
  167. dwBufSize the size in bytes of the space where lpBuffer points
  168. =item *
  169. lpFormat a pointer to the parameter specifier; can be NULL. See L</"Format String">
  170. =item *
  171. lpVoid1...8 pointers to parameters that will be interpreted based on lpFormat
  172. =item RETURNS:
  173. =item *
  174. A zero if no error; otherwise error code. See L</"Error Codes">
  175. =back
  176. =head2 PerlEzCall
  177. =over
  178. int PerlEzCall(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  179. LPCSTR lpFormat, ...);
  180. =item DESCRIPTION:
  181. =item *
  182. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  183. =item PARAMS:
  184. =item *
  185. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  186. =item *
  187. lpFunction a pointer name of the function to call
  188. =item *
  189. lpBuffer a pointer to the buffer where the result will be placed
  190. =item *
  191. dwBufSize the size in bytes of the space where lpBuffer points
  192. =item *
  193. lpFormat a pointer to the parameter specifier; can be NULL. See L</"Format String">
  194. =item *
  195. ... parameters to be interpreted based on lpFormat
  196. =item RETURNS:
  197. =item *
  198. A zero if no error; otherwise error code. See L</"Error Codes">
  199. =back
  200. =head2 PerlEzCallContext
  201. =over
  202. int PerlEzCallContext(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPVOID lpContextInfo,
  203. LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, ...);
  204. =item DESCRIPTION:
  205. =item *
  206. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  207. =item PARAMS:
  208. =item *
  209. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  210. =item *
  211. lpFunction a pointer name of the function to call
  212. =item *
  213. lpContextInfo context info for magic fetch and store functions
  214. =item *
  215. lpBuffer a pointer to the buffer where the result will be placed
  216. =item *
  217. dwBufSize the size in bytes of the space where lpBuffer points
  218. =item *
  219. lpFormat a pointer to the parameter specifier; can be NULL. See L</"Format String">
  220. =item *
  221. ... parameters to be interpreted based on lpFormat
  222. =item RETURNS:
  223. =item *
  224. A zero if no error; otherwise error code. See L</"Error Codes">
  225. =back
  226. =head2 PerlEzSetMagicScalarFunctions
  227. =over
  228. int PerlEzSetMagicScalarFunctions(PERLEZHANDLE hHandle, LPFETCHVALUEFUNCTION lpfFetch,
  229. LPSTOREVALUEFUNCTION lpfStore);
  230. =item DESCRIPTION:
  231. =item *
  232. Sets the call back function pointers for magic scalar variables.
  233. =item PARAMS:
  234. =item *
  235. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  236. =item *
  237. lpfFetch a pointer to the call back function for fetching a string.
  238. if lpfFetch is NULL, then the scalar is write only.
  239. =item *
  240. lpfStore a pointer to the call back function for storinging a string.
  241. if lpfStore is NULL, then the scalar is read only.
  242. =item RETURNS:
  243. =item *
  244. A zero if no error; otherwise error code. See L</"Error Codes">
  245. NOTE: if lpfFetch and lpfStore are both NULL, then it is an error.
  246. See also L</PerlEzSetMagicScalarName>
  247. =back
  248. =head2 PerlEzSetMagicScalarName
  249. =over
  250. int PerlEzSetMagicScalarName(PERLEZHANDLE hHandle, LPCSTR pVariableName);
  251. =item DESCRIPTION:
  252. =item *
  253. Creates the variable if it does not exists and sets it to be tied to
  254. the call back function pointer for magic variables.
  255. =item PARAMS:
  256. =item *
  257. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  258. =item *
  259. pVariableName a pointer to the name of the variable.
  260. =item RETURNS:
  261. =item *
  262. A zero if no error; otherwise error code. See L</"Error Codes">
  263. See also L</PerlEzSetMagicScalarFunctions>
  264. =back
  265. =head2 Format String
  266. =over
  267. The format string is a series of characters that represents the type of parameters being supplied.
  268. =item s
  269. =item *
  270. this parameter is a pointer to a null terminated string.
  271. =item i
  272. =item *
  273. this parameter is to be considered an integer.
  274. =item d
  275. =item *
  276. this parameter is to be considered a double.
  277. =item l[s | i | d]x
  278. =item *
  279. the next 'x' parameters will be put into an anonymous list of the type specifed. Either 's', 'i', or 'd'
  280. =back
  281. =head2 Error Codes
  282. =over
  283. =item 1
  284. More space is needed to return a result
  285. =item 2
  286. Error string returned in the buffer
  287. =item 3
  288. More space needed to return the error message
  289. =item 4
  290. Format string is invalid
  291. =item 5
  292. Function call caused an exception
  293. =item 6
  294. Handle is invalid
  295. =item 7
  296. The second call to PerlEzSetMagicFunction failed
  297. =item 8
  298. Invalid parameter was passed to the routine
  299. =item 9
  300. Cannot allocate more memory
  301. =back
  302. =head1 AUTHORS
  303. This document is maintained by Douglas Lankshear <[email protected]>