Source code of Windows XP (NT5)
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.

46 lines
1.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998-1999.
  5. //
  6. // File: dynamlnk.h
  7. //
  8. // Contents: DynamicDLL
  9. //
  10. //----------------------------------------------------------------------------
  11. //+---------------------------------------------------------------------------
  12. //
  13. // Microsoft Windows
  14. // Copyright (C) Microsoft Corporation, 1997.
  15. //
  16. // File: DynamLnk.h
  17. //
  18. // Contents: Base class for DLLs which are loaded only when needed
  19. //
  20. //----------------------------------------------------------------------------
  21. #ifndef __DYNAMLNK_H_INCLUDED__
  22. #define __DYNAMLNK_H_INCLUDED__
  23. class DynamicDLL
  24. {
  25. public:
  26. // These strings must remain unchanged until the FileServiceProvider is released
  27. DynamicDLL(LPCWSTR ptchLibraryName, LPCSTR* apchFunctionNames);
  28. virtual ~DynamicDLL();
  29. BOOL LoadFunctionPointers();
  30. FARPROC QueryFunctionPtr(INT i) const;
  31. inline FARPROC operator[] (INT i) const
  32. { return QueryFunctionPtr(i); }
  33. private:
  34. HMODULE m_hLibrary;
  35. FARPROC* m_apfFunctions;
  36. LPCWSTR m_ptchLibraryName;
  37. LPCSTR* m_apchFunctionNames;
  38. INT m_nNumFunctions;
  39. };
  40. #endif // ~__DYNAMLNK_H_INCLUDED__