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.

67 lines
1.6 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: handles.h
  6. * Content: Handle manager header file
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 08/19/99 mjn Created
  12. * 03/23/00 mjn Revised to ensure 64-bit compliance
  13. * 07/09/00 rmt Added signature bytes
  14. *
  15. ***************************************************************************/
  16. #ifndef __HANDLES_H__
  17. #define __HANDLES_H__
  18. typedef struct
  19. {
  20. DWORD dwSerial;
  21. union
  22. {
  23. void *pvData;
  24. DWORD dwIndex;
  25. } Entry;
  26. } HANDLEELEMENT;
  27. #define DPLSIGNATURE_HANDLESTRUCT 'THLL'
  28. #define DPLSIGNATURE_HANDLESTRUCT_FREE 'LHL_'
  29. typedef struct _HANDLESTRUCT
  30. {
  31. DWORD dwSignature;
  32. DWORD dwNumHandles;
  33. DWORD dwFirstFreeHandle;
  34. DWORD dwLastFreeHandle;
  35. DWORD dwNumFreeHandles;
  36. DWORD dwSerial;
  37. DNCRITICAL_SECTION dncs;
  38. HANDLEELEMENT *HandleArray;
  39. } HANDLESTRUCT;
  40. HRESULT H_Grow(HANDLESTRUCT *const phs,
  41. const DWORD dwIncSize);
  42. HRESULT H_Initialize(HANDLESTRUCT *const phs,
  43. const DWORD dwInitialNum);
  44. void H_Terminate(HANDLESTRUCT *const phs);
  45. HRESULT H_Create(HANDLESTRUCT *const phs,
  46. void *const pvData,
  47. DWORD *const pHandle);
  48. HRESULT H_Destroy(HANDLESTRUCT *const phs,
  49. const DWORD handle);
  50. HRESULT H_Retrieve(HANDLESTRUCT *const phs,
  51. const DWORD handle,
  52. void **const ppvData);
  53. HRESULT H_Enum(HANDLESTRUCT *const phs,
  54. DWORD *const pdwNumHandles,
  55. DWORD *const rgHandles);
  56. #endif // __HANDLES_H__