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.

129 lines
2.4 KiB

  1. #pragma once
  2. #include "compdefs.h"
  3. #include "comp.h"
  4. BOOL
  5. FIsFilterDevice (HDEVINFO hdi, PSP_DEVINFO_DATA pdeid);
  6. PWSTR
  7. GetNextStringToken (
  8. IN OUT PWSTR pszString,
  9. IN PCWSTR pszDelims,
  10. OUT PWSTR* ppszNextToken);
  11. HRESULT
  12. HrOpenNetworkKey (
  13. IN REGSAM samDesired,
  14. OUT HKEY* phkey);
  15. HRESULT
  16. HrRegCreateKeyWithWorldAccess (
  17. HKEY hkey,
  18. PCWSTR pszSubkey,
  19. DWORD dwOptions,
  20. REGSAM samDesired,
  21. PHKEY phkey,
  22. LPDWORD pdwDisposition);
  23. LONG
  24. RegQueryValueType (
  25. IN HKEY hkey,
  26. IN PCWSTR pszValueName,
  27. IN DWORD dwType,
  28. OUT BYTE* pbData OPTIONAL,
  29. IN OUT DWORD* pcbData);
  30. LONG
  31. RegQueryGuid (
  32. IN HKEY hkey,
  33. IN PCWSTR pszValueName,
  34. OUT GUID* pguidData OPTIONAL,
  35. IN OUT DWORD* pcbData
  36. );
  37. VOID
  38. SignalNetworkProviderLoaded (
  39. VOID);
  40. VOID
  41. CreateInstanceKeyPath (
  42. NETCLASS Class,
  43. const GUID& InstanceGuid,
  44. PWSTR pszPath);
  45. VOID
  46. AddOrRemoveDontExposeLowerCharacteristicIfNeeded (
  47. IN OUT CComponent* pComponent);
  48. class CDynamicBuffer
  49. {
  50. private:
  51. PBYTE m_pbBuffer;
  52. ULONG m_cbConsumed;
  53. ULONG m_cbAllocated;
  54. ULONG m_cbGranularity;
  55. BOOL
  56. FGrowBuffer (
  57. ULONG cbGrow);
  58. public:
  59. CDynamicBuffer ()
  60. {
  61. ZeroMemory (this, sizeof(*this));
  62. }
  63. ~CDynamicBuffer ()
  64. {
  65. MemFree (m_pbBuffer);
  66. }
  67. VOID
  68. Clear ()
  69. {
  70. // Most of the time, the buffer is treated as a string. Setting
  71. // the buffer to an empty string is a convienence for callers who
  72. // clear the buffer then try to use it as a string. This way, they
  73. // don't have to check the CountOfBytesUsed before accessing the
  74. // buffer contents.
  75. //
  76. AssertH (m_pbBuffer);
  77. AssertH (m_cbAllocated > sizeof(WCHAR));
  78. *((PWCHAR)m_pbBuffer) = 0;
  79. m_cbConsumed = 0;
  80. }
  81. ULONG
  82. CountOfBytesUsed ()
  83. {
  84. return m_cbConsumed;
  85. }
  86. const BYTE*
  87. PbBuffer ()
  88. {
  89. AssertH (m_pbBuffer);
  90. return m_pbBuffer;
  91. }
  92. VOID
  93. SetGranularity (
  94. ULONG cbGranularity)
  95. {
  96. m_cbGranularity = cbGranularity;
  97. }
  98. HRESULT
  99. HrReserveBytes (
  100. ULONG cbReserve);
  101. HRESULT
  102. HrCopyBytes (
  103. const BYTE* pbSrc,
  104. ULONG cbSrc);
  105. HRESULT
  106. HrCopyString (
  107. PCWSTR pszSrc);
  108. };