home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / adsi / sampprov / libmain.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-29  |  1.1 KB  |  63 lines

  1. /*++
  2.  
  3. Copyright (c) 1996 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     LibMain.h
  8.  
  9. Abstract:
  10.  
  11. Author:
  12.  
  13. Environment:
  14.  
  15.     User mode
  16.  
  17. Revision History :
  18.  
  19. --*/
  20.  
  21. #ifndef _LIBMAIN_H_
  22. #define _LIBMAIN_H_
  23.  
  24. //+------------------------------------------------------------------------
  25. //
  26. //  Globals in DLL
  27. //
  28. //-------------------------------------------------------------------------
  29.  
  30. extern HINSTANCE g_hInst;           // Instance of dll
  31. extern CRITICAL_SECTION g_csMem;    // for MemAlloc
  32.  
  33. //
  34. // Functions to manipulate object count variable g_ulObjCount.  This variable
  35. // is used in the implementation of DllCanUnloadNow.
  36. // NOTE: Please leave the externs within the functions so that it is not
  37. // visible outside the dll project.
  38. //
  39.  
  40. inline void
  41. INC_OBJECT_COUNT(void)
  42. {
  43.     extern ULONG g_ulObjCount;
  44.     g_ulObjCount++;
  45. }
  46.  
  47. inline void
  48. DEC_OBJECT_COUNT(void)
  49. {
  50.     extern ULONG g_ulObjCount;
  51.     ADsAssert(g_ulObjCount > 0);
  52.     g_ulObjCount--;
  53. }
  54.  
  55. inline ULONG
  56. GET_OBJECT_COUNT(void)
  57. {
  58.     extern ULONG g_ulObjCount;
  59.     return g_ulObjCount;
  60. }
  61.  
  62. #endif // #ifndef _LIBMAIN_H_
  63.