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.

60 lines
1.4 KiB

  1. // global.h
  2. #ifndef GLOBAL_H
  3. #define GLOBAL_H
  4. // all static and dynamic objects must go here so we can avoid all that nasty
  5. // forward referencing currently going on in the .h files
  6. typedef void *GHANDLE;
  7. typedef struct tagGLOBAL
  8. {
  9. #ifndef WINCE
  10. CRITICAL_SECTION cs;
  11. #endif
  12. GHANDLE *rgHandle;
  13. int cHandle;
  14. int cHandleMax;
  15. ABSTIME atTickRef;
  16. int nSamplingRate; // samples / second
  17. } GLOBAL;
  18. #define CLUSTER_DELTAMEAS 2
  19. #define CLUSTER_CMEASMAX 50
  20. extern GLOBAL global;
  21. #ifdef WINCE
  22. #define ENTER_HANDLE_MANAGER
  23. #define LEAVE_HANDLE_MANAGER
  24. #else
  25. #define ENTER_HANDLE_MANAGER EnterCriticalSection(&global.cs);
  26. #define LEAVE_HANDLE_MANAGER LeaveCriticalSection(&global.cs);
  27. #endif
  28. #define RgHandleValidGlobal() global.rgHandleValid
  29. #define CHandleValidGlobal() global.cHandleValid
  30. #define CHandleValidMaxGlobal() global.cHandleValidMax
  31. #define AtTickRefGlobal() global.atTickRef
  32. #define NSamplingRateGlobal() global.nSamplingRate
  33. #ifdef DBG
  34. # define CB_DEBUGSTRING 256
  35. extern wchar_t szDebugString[];
  36. #endif //DBG
  37. #define CHANDLE_ALLOC 8
  38. #define AddValidHRC(hrc) AddValidHANDLE((GHANDLE) hrc)
  39. #define RemoveValidHRC(hrc) RemoveValidHANDLE((GHANDLE) hrc)
  40. #define VerifyHRC(hrc) VerifyHANDLE((GHANDLE) hrc)
  41. BOOL InitGLOBAL(VOID);
  42. void DestroyGLOBAL(VOID);
  43. BOOL PUBLIC AddValidHANDLE(GHANDLE handle);
  44. VOID PUBLIC RemoveValidHANDLE(GHANDLE handle);
  45. BOOL PUBLIC VerifyHANDLE(GHANDLE handle);
  46. #endif