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.

592 lines
20 KiB

  1. //*************************************************************
  2. // File name: dllload.h
  3. //
  4. // Description: DLL loading function proto-types
  5. //
  6. //
  7. // Microsoft Confidential
  8. // Copyright (c) Microsoft Corporation 1999
  9. // All rights reserved
  10. //
  11. //*************************************************************
  12. void InitializeAPIs( void );
  13. void CloseApiDLLsCritSec( void );
  14. //
  15. // NETAPI32 functions
  16. //
  17. typedef DWORD (WINAPI * PFNDSGETDCNAMEA)(LPCSTR ComputerName,
  18. LPCSTR DomainName,
  19. GUID *DomainGuid,
  20. LPCSTR SiteName,
  21. ULONG Flags,
  22. PDOMAIN_CONTROLLER_INFOA *DomainControllerInfo);
  23. typedef DWORD (WINAPI * PFNDSGETDCNAMEW) (LPCWSTR ComputerName,
  24. LPCWSTR DomainName,
  25. GUID *DomainGuid,
  26. LPCWSTR SiteName,
  27. ULONG Flags,
  28. PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo);
  29. typedef DWORD (WINAPI * PFNDSGETSITENAMEA)(IN LPCSTR ComputerName OPTIONAL,
  30. OUT LPSTR *SiteName);
  31. typedef DWORD (WINAPI * PFNDSGETSITENAMEW)(IN LPCWSTR ComputerName OPTIONAL,
  32. OUT LPWSTR *SiteName);
  33. typedef DWORD (WINAPI * PFNDSROLEGETPRIMARYDOMAININFORMATION)(
  34. IN LPCWSTR lpServer OPTIONAL,
  35. IN DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
  36. OUT PBYTE *Buffer );
  37. typedef VOID (WINAPI * PFNDSROLEFREEMEMORY)(IN PVOID Buffer);
  38. typedef DWORD (*PFNNETAPIBUFFERFREE)(LPVOID Buffer);
  39. typedef DWORD (*PFNNETUSERGETGROUPS)(
  40. LPCWSTR servername,
  41. LPCWSTR username,
  42. DWORD level,
  43. LPBYTE *bufptr,
  44. DWORD prefmaxlen,
  45. LPDWORD entriesread,
  46. LPDWORD totalentries
  47. );
  48. typedef DWORD (*PFNNETUSERGETINFO) (
  49. IN LPCWSTR servername OPTIONAL,
  50. IN LPCWSTR username,
  51. IN DWORD level,
  52. OUT LPBYTE *bufptr
  53. );
  54. #ifdef UNICODE
  55. #define PFNDSGETDCNAME PFNDSGETDCNAMEW
  56. #define PFNDSGETSITENAME PFNDSGETSITENAMEW
  57. #else
  58. #define PFNDSGETDCNAME PFNDSGETDCNAMEA
  59. #define PFNDSGETSITENAME PFNDSGETSITENAMEA
  60. #endif
  61. typedef struct _NETAPI32_API {
  62. HINSTANCE hInstance;
  63. PFNDSGETDCNAME pfnDsGetDcName;
  64. PFNDSGETSITENAME pfnDsGetSiteName;
  65. PFNDSROLEGETPRIMARYDOMAININFORMATION pfnDsRoleGetPrimaryDomainInformation;
  66. PFNDSROLEFREEMEMORY pfnDsRoleFreeMemory;
  67. PFNNETAPIBUFFERFREE pfnNetApiBufferFree;
  68. PFNNETUSERGETGROUPS pfnNetUserGetGroups;
  69. PFNNETUSERGETINFO pfnNetUserGetInfo;
  70. } NETAPI32_API, *PNETAPI32_API;
  71. PNETAPI32_API LoadNetAPI32 ();
  72. //
  73. // SECUR32 functions
  74. //
  75. typedef BOOLEAN (*PFNGETUSERNAMEEXA)(
  76. EXTENDED_NAME_FORMAT NameFormat,
  77. LPSTR lpNameBuffer,
  78. PULONG nSize
  79. );
  80. typedef BOOLEAN (*PFNGETUSERNAMEEXW)(
  81. EXTENDED_NAME_FORMAT NameFormat,
  82. LPWSTR lpNameBuffer,
  83. PULONG nSize
  84. );
  85. typedef BOOLEAN (*PFNGETCOMPUTEROBJECTNAMEA)(
  86. EXTENDED_NAME_FORMAT NameFormat,
  87. LPSTR lpNameBuffer,
  88. PULONG nSize
  89. );
  90. typedef BOOLEAN (*PFNGETCOMPUTEROBJECTNAMEW)(
  91. EXTENDED_NAME_FORMAT NameFormat,
  92. LPWSTR lpNameBuffer,
  93. PULONG nSize
  94. );
  95. typedef BOOLEAN (*PFNTRANSLATENAMEA)(
  96. IN LPCSTR lpAccountName,
  97. IN EXTENDED_NAME_FORMAT AccountNameFormat,
  98. IN EXTENDED_NAME_FORMAT DesiredNameFormat,
  99. IN LPSTR lpTranslatedName,
  100. IN PULONG nSize
  101. );
  102. typedef BOOLEAN (*PFNTRANSLATENAMEW)(
  103. IN LPCWSTR lpAccountName,
  104. IN EXTENDED_NAME_FORMAT AccountNameFormat,
  105. IN EXTENDED_NAME_FORMAT DesiredNameFormat,
  106. IN LPWSTR lpTranslatedName,
  107. IN PULONG nSize
  108. );
  109. #ifdef UNICODE
  110. #define PFNGETUSERNAMEEX PFNGETUSERNAMEEXW
  111. #define PFNGETCOMPUTEROBJECTNAME PFNGETCOMPUTEROBJECTNAMEW
  112. #define PFNTRANSLATENAME PFNTRANSLATENAMEW
  113. #else
  114. #define PFNGETUSERNAMEEX PFNGETUSERNAMEEXA
  115. #define PFNGETCOMPUTEROBJECTNAME PFNGETCOMPUTEROBJECTNAMEA
  116. #define PFNTRANSLATENAME PFNTRANSLATENAMEA
  117. #endif
  118. typedef struct _SECUR32_API {
  119. HINSTANCE hInstance;
  120. PFNGETUSERNAMEEX pfnGetUserNameEx;
  121. PFNGETCOMPUTEROBJECTNAME pfnGetComputerObjectName;
  122. PFNTRANSLATENAME pfnTranslateName;
  123. ACCEPT_SECURITY_CONTEXT_FN pfnAcceptSecurityContext;
  124. ACQUIRE_CREDENTIALS_HANDLE_FN pfnAcquireCredentialsHandle;
  125. DELETE_SECURITY_CONTEXT_FN pfnDeleteSecurityContext;
  126. FREE_CONTEXT_BUFFER_FN pfnFreeContextBuffer;
  127. FREE_CREDENTIALS_HANDLE_FN pfnFreeCredentialsHandle;
  128. INITIALIZE_SECURITY_CONTEXT_FN pfnInitializeSecurityContext;
  129. QUERY_SECURITY_CONTEXT_TOKEN_FN pfnQuerySecurityContextToken;
  130. QUERY_SECURITY_PACKAGE_INFO_FN pfnQuerySecurityPackageInfo;
  131. } SECUR32_API, *PSECUR32_API;
  132. PSECUR32_API LoadSecur32 ();
  133. //
  134. // WLDAP32 functions
  135. //
  136. typedef LDAP * (LDAPAPI * PFNLDAP_OPENW)( PWCHAR HostName, ULONG PortNumber );
  137. typedef LDAP * (LDAPAPI * PFNLDAP_OPENA)( PCHAR HostName, ULONG PortNumber );
  138. typedef LDAP * (LDAPAPI * PFNLDAP_INITW)( PWCHAR HostName, ULONG PortNumber );
  139. typedef LDAP * (LDAPAPI * PFNLDAP_INITA)( PCHAR HostName, ULONG PortNumber );
  140. typedef ULONG (LDAPAPI * PFNLDAP_BIND_SW)( LDAP *ld, PWCHAR dn, PWCHAR cred, ULONG method );
  141. typedef ULONG (LDAPAPI * PFNLDAP_BIND_SA)( LDAP *ld, PCHAR dn, PCHAR cred, ULONG method );
  142. typedef ULONG (LDAPAPI * PFNLDAP_SEARCH_SW)(
  143. LDAP *ld,
  144. PWCHAR base,
  145. ULONG scope,
  146. PWCHAR filter,
  147. PWCHAR attrs[],
  148. ULONG attrsonly,
  149. LDAPMessage **res
  150. );
  151. typedef ULONG (LDAPAPI * PFNLDAP_SEARCH_SA)(
  152. LDAP *ld,
  153. PCHAR base,
  154. ULONG scope,
  155. PCHAR filter,
  156. PCHAR attrs[],
  157. ULONG attrsonly,
  158. LDAPMessage **res
  159. );
  160. typedef ULONG (LDAPAPI * PFNLDAP_SEARCH_EXT_SW)(
  161. LDAP *ld,
  162. PWCHAR base,
  163. ULONG scope,
  164. PWCHAR filter,
  165. PWCHAR attrs[],
  166. ULONG attrsonly,
  167. PLDAPControlW *ServerControls,
  168. PLDAPControlW *ClientControls,
  169. struct l_timeval *timeout,
  170. ULONG SizeLimit,
  171. LDAPMessage **res
  172. );
  173. typedef ULONG (LDAPAPI * PFNLDAP_SEARCH_EXT_SA)(
  174. LDAP *ld,
  175. PCHAR base,
  176. ULONG scope,
  177. PCHAR filter,
  178. PCHAR attrs[],
  179. ULONG attrsonly,
  180. PLDAPControlA *ServerControls,
  181. PLDAPControlA *ClientControls,
  182. struct l_timeval *timeout,
  183. ULONG SizeLimit,
  184. LDAPMessage **res
  185. );
  186. typedef PWCHAR * (LDAPAPI * PFNLDAP_GET_VALUESW)(
  187. LDAP *ld,
  188. LDAPMessage *entry,
  189. PWCHAR attr
  190. );
  191. typedef PCHAR * (LDAPAPI * PFNLDAP_GET_VALUESA)(
  192. LDAP *ld,
  193. LDAPMessage *entry,
  194. PCHAR attr
  195. );
  196. typedef ULONG (LDAPAPI * PFNLDAP_VALUE_FREEW)( PWCHAR *vals );
  197. typedef ULONG (LDAPAPI * PFNLDAP_VALUE_FREEA)( PCHAR *vals );
  198. typedef struct berval ** (LDAPAPI * PFNLDAP_GET_VALUES_LENW)(
  199. LDAP *ExternalHandle,
  200. LDAPMessage *Message,
  201. PWCHAR attr
  202. );
  203. typedef struct berval ** (LDAPAPI * PFNLDAP_GET_VALUES_LENA) (
  204. LDAP *ExternalHandle,
  205. LDAPMessage *Message,
  206. PCHAR attr
  207. );
  208. typedef ULONG (LDAPAPI * PFNLDAP_VALUE_FREE_LEN)( struct berval **vals );
  209. typedef ULONG (LDAPAPI * PFNLDAP_MSGFREE)( LDAPMessage *res );
  210. typedef ULONG (LDAPAPI * PFNLDAP_UNBIND)( LDAP *ld );
  211. typedef ULONG (LDAPAPI * PFNLDAPGETLASTERROR)( VOID );
  212. typedef PWCHAR (LDAPAPI * PFNLDAP_ERR2STRINGW)( ULONG );
  213. typedef PCHAR (LDAPAPI * PFNLDAP_ERR2STRINGA)( ULONG );
  214. typedef LDAPMessage * (LDAPAPI * PFNLDAP_FIRST_ENTRY)( LDAP *ld, LDAPMessage *entry );
  215. typedef LDAPMessage * (LDAPAPI * PFNLDAP_NEXT_ENTRY)( LDAP *ld, LDAPMessage *entry );
  216. typedef PWCHAR (LDAPAPI * PFNLDAP_GET_DNW)( LDAP *ld, LDAPMessage *entry );
  217. typedef PCHAR (LDAPAPI * PFNLDAP_GET_DNA)( LDAP *ld, LDAPMessage *entry );
  218. typedef ULONG (LDAPAPI *PFNLDAP_SET_OPTION)( LDAP *ld, int option, void *invalue );
  219. typedef ULONG (LDAPAPI *PFNLDAP_SET_OPTIONW)( LDAP *ld, int option, void *invalue );
  220. typedef VOID (LDAPAPI * PFNLDAP_MEMFREEW)( PWCHAR Block );
  221. typedef VOID (LDAPAPI * PFNLDAP_MEMFREEA)( PCHAR Block );
  222. typedef ULONG (LDAPAPI * PFNLDAP_CONNECT)( LDAP *ld, struct l_timeval *timeout );
  223. typedef ULONG (LDAPAPI * PFNLDAPMAPERRORTOWIN32)( ULONG LdapError );
  224. //
  225. // WNet functions
  226. //
  227. typedef DWORD (*PFNWNETGETCONNECTION)(LPCTSTR lpLocalName, LPTSTR lpRemoteName, LPDWORD lpnLength);
  228. typedef DWORD (*PFNWNETGETRESOURCEINFORMATION)(LPNETRESOURCE lpNetResource, LPVOID lpBuffer, LPDWORD lpcbBuffer, LPTSTR *lplpSystem);
  229. //
  230. // msi functions
  231. //
  232. typedef UINT (*PFNMSINOTIFYSIDCHANGE)(LPCTSTR pOldSid, LPCTSTR pNewSid);
  233. typedef UINT (*PFNMSIDELETEUSERDATA)(LPCTSTR pSid, LPCTSTR szComputerName, LPVOID pReserved);
  234. #ifdef UNICODE
  235. #define PFNLDAP_OPEN PFNLDAP_OPENW
  236. #define PFNLDAP_INIT PFNLDAP_INITW
  237. #define PFNLDAP_BIND_S PFNLDAP_BIND_SW
  238. #define PFNLDAP_SEARCH_S PFNLDAP_SEARCH_SW
  239. #define PFNLDAP_SEARCH_EXT_S PFNLDAP_SEARCH_EXT_SW
  240. #define PFNLDAP_GET_VALUES PFNLDAP_GET_VALUESW
  241. #define PFNLDAP_VALUE_FREE PFNLDAP_VALUE_FREEW
  242. #define PFNLDAP_GET_VALUES_LEN PFNLDAP_GET_VALUES_LENW
  243. #define PFNLDAP_GET_DN PFNLDAP_GET_DNW
  244. #define PFNLDAP_MEMFREE PFNLDAP_MEMFREEW
  245. #define PFNLDAP_SET_OPTION PFNLDAP_SET_OPTIONW
  246. #define PFNLDAP_ERR2STRING PFNLDAP_ERR2STRINGW
  247. #else
  248. #define PFNLDAP_OPEN PFNLDAP_OPENA
  249. #define PFNLDAP_INIT PFNLDAP_INITA
  250. #define PFNLDAP_BIND_S PFNLDAP_BIND_SA
  251. #define PFNLDAP_SEARCH_S PFNLDAP_SEARCH_SA
  252. #define PFNLDAP_SEARCH_EXT_S PFNLDAP_SEARCH_EXT_SA
  253. #define PFNLDAP_GET_VALUES PFNLDAP_GET_VALUESA
  254. #define PFNLDAP_VALUE_FREE PFNLDAP_VALUE_FREEA
  255. #define PFNLDAP_GET_VALUES_LEN PFNLDAP_GET_VALUES_LENA
  256. #define PFNLDAP_GET_DN PFNLDAP_GET_DNA
  257. #define PFNLDAP_MEMFREE PFNLDAP_MEMFREEA
  258. #define PFNLDAP_ERR2STRING PFNLDAP_ERR2STRINGA
  259. #endif
  260. typedef struct _LDAP_API {
  261. HINSTANCE hInstance;
  262. PFNLDAP_OPEN pfnldap_open;
  263. PFNLDAP_INIT pfnldap_init;
  264. PFNLDAP_CONNECT pfnldap_connect;
  265. PFNLDAP_BIND_S pfnldap_bind_s;
  266. PFNLDAP_SEARCH_S pfnldap_search_s;
  267. PFNLDAP_SEARCH_EXT_S pfnldap_search_ext_s;
  268. PFNLDAP_GET_VALUES pfnldap_get_values;
  269. PFNLDAP_VALUE_FREE pfnldap_value_free;
  270. PFNLDAP_GET_VALUES_LEN pfnldap_get_values_len;
  271. PFNLDAP_VALUE_FREE_LEN pfnldap_value_free_len;
  272. PFNLDAP_MSGFREE pfnldap_msgfree;
  273. PFNLDAP_UNBIND pfnldap_unbind;
  274. PFNLDAPGETLASTERROR pfnLdapGetLastError;
  275. PFNLDAP_FIRST_ENTRY pfnldap_first_entry;
  276. PFNLDAP_NEXT_ENTRY pfnldap_next_entry;
  277. PFNLDAP_GET_DN pfnldap_get_dn;
  278. PFNLDAP_SET_OPTION pfnldap_set_option;
  279. PFNLDAP_MEMFREE pfnldap_memfree;
  280. PFNLDAPMAPERRORTOWIN32 pfnLdapMapErrorToWin32;
  281. PFNLDAP_ERR2STRING pfnldap_err2string;
  282. } LDAP_API, *PLDAP_API;
  283. PLDAP_API LoadLDAP();
  284. //
  285. // ICMP functions
  286. //
  287. typedef HANDLE (*PFNICMPCREATEFILE)(VOID);
  288. typedef BOOL (*PFNICMPCLOSEHANDLE)(HANDLE IcmpHandle);
  289. typedef DWORD (*PFNICMPSENDECHO)(
  290. HANDLE IcmpHandle,
  291. IPAddr DestinationAddress,
  292. LPVOID RequestData,
  293. WORD RequestSize,
  294. PIP_OPTION_INFORMATION RequestOptions,
  295. LPVOID ReplyBuffer,
  296. DWORD ReplySize,
  297. DWORD Timeout
  298. );
  299. typedef struct _ICMP_API {
  300. HINSTANCE hInstance;
  301. PFNICMPCREATEFILE pfnIcmpCreateFile;
  302. PFNICMPCLOSEHANDLE pfnIcmpCloseHandle;
  303. PFNICMPSENDECHO pfnIcmpSendEcho;
  304. } ICMP_API, *PICMP_API;
  305. DWORD LoadIcmp (PICMP_API *);
  306. //
  307. // WSOCK32 functions
  308. //
  309. typedef struct _WSOCK32_API {
  310. HINSTANCE hInstance;
  311. LPFN_INET_ADDR pfninet_addr;
  312. LPFN_GETHOSTBYNAME pfngethostbyname;
  313. } WSOCK32_API, *PWSOCK32_API;
  314. PWSOCK32_API LoadWSock32 ();
  315. //
  316. // DSAPI functions
  317. //
  318. typedef DWORD (WINAPI *PFN_DSCRACKNAMESW)( HANDLE hDS,
  319. DS_NAME_FLAGS flags,
  320. DS_NAME_FORMAT formatOffered,
  321. DS_NAME_FORMAT formatDesired,
  322. DWORD cNames,
  323. const LPCWSTR *rpNames,
  324. PDS_NAME_RESULTW *ppResult);
  325. typedef DWORD (WINAPI *PFN_DSCRACKNAMESA)( HANDLE hDS,
  326. DS_NAME_FLAGS flags,
  327. DS_NAME_FORMAT formatOffered,
  328. DS_NAME_FORMAT formatDesired,
  329. DWORD cNames,
  330. const LPCSTR *rpNames,
  331. PDS_NAME_RESULTA *ppResult);
  332. typedef void (WINAPI *PFN_DSFREENAMERESULTW)( DS_NAME_RESULTW *pResult);
  333. typedef void (WINAPI *PFN_DSFREENAMERESULTA)( DS_NAME_RESULTA *pResult);
  334. #ifdef UNICODE
  335. #define PFN_DSCRACKNAMES PFN_DSCRACKNAMESW
  336. #define PFN_DSFREENAMERESULT PFN_DSFREENAMERESULTW
  337. #else
  338. #define PFN_DSCRACKNAMES PFN_DSCRACKNAMESA
  339. #define PFN_DSFREENAMERESULT PFN_DSFREENAMERESULTA
  340. #endif
  341. typedef struct _DS_API {
  342. HINSTANCE hInstance;
  343. PFN_DSCRACKNAMES pfnDsCrackNames;
  344. PFN_DSFREENAMERESULT pfnDsFreeNameResult;
  345. } DS_API, *PDS_API;
  346. PDS_API LoadDSApi();
  347. //
  348. // Ole32 functions
  349. //
  350. typedef HRESULT (*PFNCOCREATEINSTANCE)(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
  351. DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv);
  352. typedef HRESULT (*PFNCOINITIALIZE)(LPVOID pvReserved);
  353. typedef HRESULT (*PFNCOINITIALIZEEX)(LPVOID pvReserved, DWORD dwCoInit);
  354. typedef VOID (*PFNCOUNINITIALIZE)(VOID);
  355. typedef HRESULT (*PFNCOCREATEGUID)(GUID *pGuid );
  356. typedef VOID (*PFNINITCOMMONCONTROLS)(VOID);
  357. typedef struct _OLE32_API {
  358. HINSTANCE hInstance;
  359. PFNCOCREATEINSTANCE pfnCoCreateInstance;
  360. PFNCOINITIALIZEEX pfnCoInitializeEx;
  361. PFNCOUNINITIALIZE pfnCoUnInitialize;
  362. PFNCOCREATEGUID pfnCoCreateGuid;
  363. } OLE32_API, *POLE32_API;
  364. POLE32_API LoadOle32Api();
  365. //
  366. // Shell32 functions
  367. //
  368. typedef VOID (*PFNSHCHANGENOTIFY)(LONG wEventId, UINT uFlags,
  369. LPCVOID dwItem1, LPCVOID dwItem2);
  370. typedef BOOL (*PFNSHGETSPECIALFOLDERPATHA)(HWND hwnd, LPSTR lpszPath,
  371. int csidl, BOOL fCreate);
  372. typedef BOOL (*PFNSHGETSPECIALFOLDERPATHW)(HWND hwnd, LPWSTR lpszPath,
  373. int csidl, BOOL fCreate);
  374. typedef HRESULT (*PFNSHGETFOLDERPATHA)(HWND hwnd, int csidl, HANDLE hToken,
  375. DWORD dwFlags, LPSTR pszPath);
  376. typedef HRESULT (*PFNSHGETFOLDERPATHW)(HWND hwnd, int csidl, HANDLE hToken,
  377. DWORD dwFlags, LPWSTR pszPath);
  378. typedef HRESULT (*PFNSHSETFOLDERPATHA)(int csidl, HANDLE hToken,
  379. DWORD dwFlags, LPSTR pszPath);
  380. typedef HRESULT (*PFNSHSETFOLDERPATHW)(int csidl, HANDLE hToken,
  381. DWORD dwFlags, LPWSTR pszPath);
  382. typedef HRESULT (*PFNSHSETLOCALIZEDNAME)(LPWSTR pszPath,
  383. LPCWSTR pszResModule, int idsRes);
  384. #ifdef UNICODE
  385. #define PFNSHGETSPECIALFOLDERPATH PFNSHGETSPECIALFOLDERPATHW
  386. #define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHW
  387. #define PFNSHSETFOLDERPATH PFNSHSETFOLDERPATHW
  388. #else
  389. #define PFNSHGETSPECIALFOLDERPATH PFNSHGETSPECIALFOLDERPATHA
  390. #define PFNSHGETFOLDERPATH PFNSHGETFOLDERPATHA
  391. #define PFNSHSETFOLDERPATH PFNSHSETFOLDERPATHA
  392. #endif
  393. #define SHSetFolderA_Ord 231
  394. #define SHSetFolderW_Ord 232
  395. typedef struct _SHELL32_API {
  396. HINSTANCE hInstance;
  397. PFNSHGETSPECIALFOLDERPATH pfnShGetSpecialFolderPath;
  398. PFNSHGETFOLDERPATH pfnShGetFolderPath;
  399. PFNSHSETFOLDERPATH pfnShSetFolderPath;
  400. PFNSHCHANGENOTIFY pfnShChangeNotify;
  401. PFNSHSETLOCALIZEDNAME pfnShSetLocalizedName;
  402. } SHELL32_API, *PSHELL32_API;
  403. DWORD LoadShell32Api( PSHELL32_API * );
  404. //
  405. // shlwapi functions
  406. //
  407. typedef LPSTR (*PFNPATHGETARGSA)(LPCSTR pszPath);
  408. typedef LPWSTR (*PFNPATHGETARGSW)(LPCWSTR pszPath);
  409. typedef VOID (*PFNPATHUNQUOTESPACESA)(LPSTR lpsz);
  410. typedef VOID (*PFNPATHUNQUOTESPACESW)(LPWSTR lpsz);
  411. #ifdef UNICODE
  412. #define PFNPATHGETARGS PFNPATHGETARGSW
  413. #define PFNPATHUNQUOTESPACES PFNPATHUNQUOTESPACESW
  414. #else
  415. #define PFNPATHGETARGS PFNPATHGETARGSA
  416. #define PFNPATHUNQUOTESPACES PFNPATHUNQUOTESPACESA
  417. #endif
  418. typedef struct _SHLWAPI_API {
  419. HINSTANCE hInstance;
  420. PFNPATHGETARGS pfnPathGetArgs;
  421. PFNPATHUNQUOTESPACES pfnPathUnquoteSpaces;
  422. } SHLWAPI_API, *PSHLWAPI_API;
  423. PSHLWAPI_API LoadShlwapiApi();
  424. //
  425. // Gptext.dll functions
  426. //
  427. typedef BOOL (*PFNPARSEADMFILE)( WCHAR *pwszAdmFile, BOOL bUser, void **ppAdmHandle );
  428. typedef BOOL (*PFNFREEADMDATA)( void *pAdmHandle );
  429. typedef DWORD (*PFNSCRREGGPOLISTTOWBEM)( LPWSTR szSID, IWbemServices* pServices );
  430. typedef struct _GPTEXT_API {
  431. HINSTANCE hInstance;
  432. PFNSCRREGGPOLISTTOWBEM pfnScrRegGPOListToWbem;
  433. } GPTEXT_API;
  434. GPTEXT_API *LoadGpTextApi();
  435. //
  436. // iphlpapi.dll functions
  437. //
  438. typedef DWORD (WINAPI *PFNGETBESTINTERFACE)(IPAddr dwDestAddr, PDWORD pdwBestIfIndex);
  439. typedef DWORD (WINAPI *PFNGETIFENTRY)(PMIB_IFROW pIfRow);
  440. typedef DWORD (WINAPI *PFNGETADAPTERINDEX)(LPWSTR, PULONG);
  441. typedef struct _IPHLPAPI_API
  442. {
  443. HINSTANCE hInstance;
  444. PFNGETBESTINTERFACE pfnGetBestInterface;
  445. PFNGETIFENTRY pfnGetIfEntry;
  446. PFNGETADAPTERINDEX pfnGetAdapterIndex;
  447. } IPHLPAPI_API, *PIPHLPAPI_API;
  448. PIPHLPAPI_API LoadIpHlpApi();
  449. //
  450. // ws2_32.dll functions
  451. //
  452. typedef INT (WINAPI *PFNWSALOOKUPSERVICEBEGIN)( LPWSAQUERYSET, DWORD, LPHANDLE );
  453. typedef INT (WINAPI *PFNWSALOOKUPSERVICENEXT)( HANDLE, DWORD, LPDWORD, LPWSAQUERYSET );
  454. typedef INT (WINAPI *PFNWSALOOKUPSERVICEEND)( HANDLE );
  455. typedef INT (WINAPI *PFNWSASTARTUP)( WORD, LPWSADATA );
  456. typedef INT (WINAPI *PFNWSACLEANUP)();
  457. typedef INT (WINAPI *PFNWSAGETLASTERROR)();
  458. typedef struct _WS2_32_API
  459. {
  460. HINSTANCE hInstance;
  461. PFNWSALOOKUPSERVICEBEGIN pfnWSALookupServiceBegin;
  462. PFNWSALOOKUPSERVICENEXT pfnWSALookupServiceNext;
  463. PFNWSALOOKUPSERVICEEND pfnWSALookupServiceEnd;
  464. PFNWSASTARTUP pfnWSAStartup;
  465. PFNWSACLEANUP pfnWSACleanup;
  466. PFNWSAGETLASTERROR pfnWSAGetLastError;
  467. } WS2_32_API, *PWS2_32_API;
  468. PWS2_32_API Loadws2_32Api();