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.

65 lines
2.2 KiB

  1. /*++=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. utils.h
  5. Abstract:
  6. Utility functions.
  7. Author:
  8. Paul M Midgen (pmidge) 12-January-2001
  9. Revision History:
  10. 12-January-2001 pmidge
  11. Created
  12. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--*/
  13. #ifndef _UTILS_H_
  14. #define _UTILS_H_
  15. // file retrieval
  16. BOOL GetFile(LPCWSTR path, HANDLE* phUNC, IWinHttpRequest** ppWHR, DWORD mode, BOOL* bReadOnly);
  17. BOOL __PathIsUNC(LPCWSTR path);
  18. BOOL __PathIsURL(LPCWSTR path);
  19. IWinHttpRequest* __OpenUrl(LPCWSTR url);
  20. HANDLE __OpenFile(LPCWSTR path, DWORD mode, BOOL* bReadOnly);
  21. // oleautomation/scripting
  22. BOOL GetJScriptCLSID(LPCLSID pclsid);
  23. HRESULT GetTypeInfoFromName(LPCOLESTR name, ITypeLib* ptl, ITypeInfo** ppti);
  24. DISPID GetDispidFromName(PDISPIDTABLEENTRY pdt, DWORD cEntries, LPWSTR name);
  25. void AddRichErrorInfo(EXCEPINFO* pei, LPWSTR source, LPWSTR description, HRESULT error);
  26. DWORD GetHash(LPWSTR name);
  27. DWORD GetHash(LPSTR name);
  28. HRESULT ProcessVariant(VARIANT* pvar, LPBYTE* ppbuf, LPDWORD pcbuf, LPDWORD pbytes);
  29. HRESULT ProcessObject(IUnknown* punk, LPBYTE* ppbuf, LPDWORD pcbuf, LPDWORD pbytes);
  30. HRESULT ValidateDispatchArgs(REFIID riid, DISPPARAMS* pdp, VARIANT* pvr, UINT* pae);
  31. HRESULT ValidateInvokeFlags(WORD flags, WORD accesstype, BOOL bNotMethod);
  32. HRESULT ValidateArgCount(DISPPARAMS* pdp, DWORD needed, BOOL bHasOptionalArgs, DWORD optional);
  33. HRESULT HandleDispatchError(LPWSTR id, EXCEPINFO* pei, HRESULT hr);
  34. // winsock
  35. void ParseSocketInfo(PIOCTX pi);
  36. void GetHostname(struct in_addr ip, LPSTR* ppsz);
  37. // string & type manipulation
  38. char* __strndup(const char* src, int len);
  39. char* __strdup(const char* src);
  40. WCHAR* __wstrndup(const WCHAR* src, int len);
  41. WCHAR* __wstrdup(const WCHAR* src);
  42. CHAR* __widetoansi(const WCHAR* pwsz);
  43. WCHAR* __ansitowide(const char* psz);
  44. BOOL __isempty(VARIANT var);
  45. BSTR __ansitobstr(LPCSTR src);
  46. BSTR __widetobstr(LPCWSTR wsrc);
  47. char* __unescape(char* str);
  48. #endif /* _UTILS_H_ */