Leaked source code of windows server 2003
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.

121 lines
4.8 KiB

  1. /****************************************************************************/
  2. // acomapi.h
  3. //
  4. // RDP common functions API header
  5. //
  6. // Copyright (C) Microsoft, PictureTel 1992-1997
  7. // Copyright (C) 1997-2000 Microsoft Corporation
  8. /****************************************************************************/
  9. #ifndef _H_ACOMAPI
  10. #define _H_ACOMAPI
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif /* __cplusplus */
  14. #include <atrcapi.h>
  15. /****************************************************************************/
  16. /* We have a circular structure dependency, so prototype the necessary data */
  17. /* here. */
  18. /****************************************************************************/
  19. typedef struct tagTSHARE_WD TSHARE_WD, *PTSHARE_WD;
  20. /****************************************************************************/
  21. // COM_Malloc
  22. //
  23. // Wrapper for paged pool allocation with WD tag.
  24. /****************************************************************************/
  25. #ifndef DLL_DISP
  26. #ifndef DC_DEBUG
  27. /****************************************************************************/
  28. /* For a free build, just call ExAllocatePoolWithTag */
  29. /****************************************************************************/
  30. __inline PVOID RDPCALL COM_Malloc(UINT32 length)
  31. {
  32. return ExAllocatePoolWithTag(PagedPool, length, WD_ALLOC_TAG);
  33. }
  34. #else /* DC_DEBUG */
  35. /****************************************************************************/
  36. /* Checked COM_Malloc - call WDW_Malloc */
  37. /****************************************************************************/
  38. PVOID RDPCALL WDW_Malloc(PTSHARE_WD, ULONG);
  39. #define COM_Malloc(len) WDW_Malloc(pTRCWd, len)
  40. #endif /* DC_DEBUG */
  41. #endif /* DLL_DISP */
  42. /****************************************************************************/
  43. // COM_Free
  44. //
  45. // Wrapper for pool deallocator.
  46. /****************************************************************************/
  47. #ifndef DLL_DISP
  48. #ifndef DC_DEBUG
  49. /****************************************************************************/
  50. /* Free build - just call ExFreePool */
  51. /****************************************************************************/
  52. __inline void RDPCALL COM_Free(PVOID pMemory)
  53. {
  54. ExFreePool(pMemory);
  55. }
  56. #else /* DC_DEBUG */
  57. /****************************************************************************/
  58. /* Checked build - call WDW_Free */
  59. /****************************************************************************/
  60. void RDPCALL WDW_Free(PVOID);
  61. #define COM_Free(pMem) WDW_Free(pMem)
  62. #endif /* DC_DEBUG */
  63. #endif /* DLL_DISP */
  64. /****************************************************************************/
  65. /* Name: COM_GETTICKCOUNT */
  66. /* */
  67. /* Purpose: Gets a tick count */
  68. /* */
  69. /* Returns: Relative time in units of 100ns. This will wrap after 429 */
  70. /* seconds. */
  71. /****************************************************************************/
  72. #ifndef DLL_DISP
  73. #define COM_GETTICKCOUNT(A) \
  74. { \
  75. LARGE_INTEGER sysTime; \
  76. KeQuerySystemTime((PLARGE_INTEGER)&sysTime); \
  77. A = sysTime.LowPart; \
  78. }
  79. #endif /* ndef DLL_DISP */
  80. /****************************************************************************/
  81. /* Prototypes for COM registry access functions */
  82. /****************************************************************************/
  83. BOOL RDPCALL COM_OpenRegistry(PTSHARE_WD pTSWd,
  84. PWCHAR pSection);
  85. void RDPCALL COM_CloseRegistry(PTSHARE_WD pTSWd);
  86. void RDPCALL COM_ReadProfInt32(PTSHARE_WD pTSWd,
  87. PWCHAR pEntry,
  88. INT32 defaultValue,
  89. long *pValue);
  90. NTSTATUS RDPCALL COMReadEntry(PTSHARE_WD pTSWd,
  91. PWCHAR pEntry,
  92. PVOID pBuffer,
  93. unsigned bufferSize,
  94. UINT32 expectedDataType);
  95. #ifdef __cplusplus
  96. }
  97. #endif /* __cplusplus */
  98. #endif /* _H_ACOMAPI */