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.

69 lines
868 B

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgloadl.cxx
  6. Abstract:
  7. Library Loader helper class
  8. Author:
  9. Steve Kiraly (SteveKi) 17-Oct-1995
  10. Revision History:
  11. --*/
  12. #include "precomp.hxx"
  13. #pragma hdrstop
  14. #include "dbgloadl.hxx"
  15. TDebugLibrary::
  16. TDebugLibrary(
  17. IN LPCTSTR pszLibName
  18. )
  19. {
  20. m_hInst = LoadLibrary( pszLibName );
  21. }
  22. TDebugLibrary::
  23. ~TDebugLibrary(
  24. )
  25. {
  26. if( bValid() )
  27. {
  28. FreeLibrary( m_hInst );
  29. }
  30. }
  31. BOOL
  32. TDebugLibrary::
  33. bValid(
  34. VOID
  35. )
  36. {
  37. return m_hInst != NULL;
  38. }
  39. FARPROC
  40. TDebugLibrary::
  41. pfnGetProc(
  42. IN LPCSTR pszProc
  43. )
  44. {
  45. return ( bValid() ) ? GetProcAddress( m_hInst, pszProc ) : NULL;
  46. }
  47. FARPROC
  48. TDebugLibrary::
  49. pfnGetProc(
  50. IN UINT_PTR uOrdinal
  51. )
  52. {
  53. return ( bValid() ) ? GetProcAddress( m_hInst, (LPCSTR)uOrdinal ) : NULL;
  54. }