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.

77 lines
2.1 KiB

  1. //=================================================================
  2. //
  3. // DllWrapperBase.h
  4. //
  5. // Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #ifndef _DLLWRAPPERBASE_H_
  9. #define _DLLWRAPPERBASE_H_
  10. #include "ResourceManager.h"
  11. #include "TimedDllResource.h"
  12. /******************************************************************************
  13. * Function pointer typedefs. Add new functions here as required.
  14. *****************************************************************************/
  15. // << section empty in base class only>>
  16. /******************************************************************************
  17. * Wrapper class to load/unload, for registration with ResourceManager.
  18. ******************************************************************************/
  19. class CDllWrapperBase : public CTimedDllResource
  20. {
  21. private:
  22. // Member variables (function pointers) pointing to dll procs.
  23. // Add new functions here as required.
  24. BOOL GetVarFromVersionInfo(LPCTSTR a_szFile,
  25. LPCTSTR a_szVar,
  26. CHString &a_strValue);
  27. BOOL GetVersionLanguage(void *a_vpInfo, WORD *a_wpLang, WORD *a_wpCodePage);
  28. HINSTANCE m_hDll; // handle to the dll this class wraps
  29. LPCTSTR m_tstrWrappedDllName; // name of dll this class wraps
  30. protected:
  31. // Handy wrapers to simplify calls and hide m_hDll...
  32. bool LoadLibrary();
  33. FARPROC GetProcAddress(LPCSTR a_strProcName);
  34. public:
  35. // Constructor and destructor:
  36. CDllWrapperBase(LPCTSTR a_chstrWrappedDllName);
  37. ~CDllWrapperBase();
  38. // Initialization function to check function pointers. Requires derived
  39. // class implementation.
  40. virtual bool Init() = 0;
  41. // Helper for retrieving the version.
  42. BOOL GetDllVersion(CHString& a_chstrVersion);
  43. // Member functions wrapping dll procs.
  44. // Add new functions here as required:
  45. // << section empty in base class only >>
  46. };
  47. #endif