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.

81 lines
2.9 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // API.H - Header for the implementation of CAPI
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. //
  12. #ifndef _API_H_
  13. #define _API_H_
  14. #include <windows.h>
  15. #include <assert.h>
  16. #include <oleauto.h>
  17. class CAPI : public IDispatch
  18. {
  19. private:
  20. ULONG m_cRef;
  21. HRESULT WrapSHGetSpecialFolderPath(HWND hwndOwner, LPWSTR lpszPath, int nFolder, BOOL fCreate);
  22. HRESULT SaveFile(LPCWSTR szPath, LPCWSTR szURL, LPCWSTR szNewFileName);
  23. HRESULT SaveFile(INT iCSIDLPath, BSTR bstrURL, BSTR bstrNewFileName);
  24. HRESULT SaveFile(BSTR bstrPath, BSTR bstrURL);
  25. HRESULT SaveFile(INT iCSIDLPath, BSTR bstrURL);
  26. HRESULT get_INIKey(BSTR bstrINIFileName, BSTR bstrSectionName, BSTR bstrKeyName, LPVARIANT pvResult);
  27. HRESULT set_RegValue(HKEY hkey, BSTR bstrSubKey, BSTR bstrValue, LPVARIANT pvData);
  28. HRESULT get_RegValue(HKEY hkey, BSTR bstrSubKey,
  29. BSTR bstrValue, LPVARIANT pvResult);
  30. HRESULT DeleteRegKey(HKEY hkey, BSTR bstrSubKey);
  31. HRESULT DeleteRegValue(HKEY hkey, BSTR bstrSubKey, BSTR bstrValue);
  32. HRESULT get_SystemDirectory(LPVARIANT pvResult);
  33. HRESULT get_CSIDLDirectory(UINT iCSIDLPath, LPVARIANT pvResult);
  34. HRESULT LoadFile(BSTR bstrPath, LPVARIANT pvResult);
  35. HRESULT get_UserDefaultLCID(LPVARIANT pvResult);
  36. HRESULT get_ComputerName(LPVARIANT pvResult);
  37. HRESULT set_ComputerName(BSTR bstrComputerName);
  38. HRESULT FlushRegKey(HKEY hkey);
  39. HRESULT ValidateComputername(BSTR bstrComputername);
  40. STDMETHOD(OEMComputername) ();
  41. STDMETHOD(FormatMessage) ( LPVARIANT pvResult, // message buffer
  42. BSTR bstrSource, // message source
  43. int cArgs, // number of inserts
  44. VARIANTARG *rgArgs // array of message inserts
  45. );
  46. STDMETHOD(set_ComputerDesc) (BSTR bstrComputerDesc);
  47. STDMETHOD(get_UserDefaultUILanguage) (LPVARIANT pvResult);
  48. public:
  49. CAPI (HINSTANCE hInstance);
  50. ~CAPI ();
  51. // IUnknown Interfaces
  52. STDMETHODIMP QueryInterface (REFIID riid, LPVOID* ppvObj);
  53. STDMETHODIMP_(ULONG) AddRef ();
  54. STDMETHODIMP_(ULONG) Release ();
  55. //IDispatch Interfaces
  56. STDMETHOD (GetTypeInfoCount) (UINT* pcInfo);
  57. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo** );
  58. STDMETHOD (GetIDsOfNames) (REFIID, OLECHAR**, UINT, LCID, DISPID* );
  59. STDMETHOD (Invoke) (DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
  60. };
  61. #endif