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.

118 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. iphlpapi\rasmap.h
  5. Abstract:
  6. Header for rasmap.h
  7. Revision History:
  8. AmritanR Created
  9. --*/
  10. #ifndef __IPHLPAPI_RASMAP__
  11. #define __IPHLPAPI_RASMAP__
  12. typedef struct _RAS_INFO_TABLE
  13. {
  14. ULONG ulTotalCount;
  15. ULONG ulValidCount;
  16. RASENUMENTRYDETAILS rgEntries[ANY_SIZE];
  17. }RAS_INFO_TABLE, *PRAS_INFO_TABLE;
  18. #define SIZEOF_RASTABLE(n) \
  19. (FIELD_OFFSET(RAS_INFO_TABLE, rgEntries[0]) + \
  20. (n) * sizeof(RASENUMENTRYDETAILS))
  21. #define INIT_RAS_ENTRY_COUNT 5
  22. #define RAS_OVERFLOW_COUNT 5
  23. #define RAS_HASH_TABLE_SIZE 13
  24. #define RAS_GUID_HASH(pg) \
  25. (((ULONG)((pg)->Data1 + *((ULONG *)(&((pg)->Data2))))) % RAS_HASH_TABLE_SIZE)
  26. typedef struct _RAS_NODE
  27. {
  28. LIST_ENTRY leGuidLink;
  29. LIST_ENTRY leNameLink;
  30. GUID Guid;
  31. WCHAR rgwcName[RASAPIP_MAX_ENTRY_NAME + 2];
  32. }RAS_NODE, *PRAS_NODE;
  33. DWORD
  34. NhiGetPhonebookNameFromGuid(
  35. IN GUID *pGuid,
  36. OUT PWCHAR pwszBuffer,
  37. IN OUT PULONG pulBufferSize,
  38. IN BOOL bRefresh,
  39. IN BOOL bCache
  40. );
  41. DWORD
  42. NhiGetGuidFromPhonebookName(
  43. IN PWCHAR pwszBuffer,
  44. OUT GUID *pGuid,
  45. IN BOOL bRefresh,
  46. IN BOOL bCache
  47. );
  48. DWORD
  49. NhiGetPhonebookDescriptionFromGuid(
  50. IN GUID *pGuid,
  51. OUT PWCHAR pwszBuffer,
  52. IN OUT PULONG pulBufferSize,
  53. IN BOOL bCache,
  54. IN BOOL bRefresh
  55. );
  56. DWORD
  57. InitRasNameMapper(
  58. VOID
  59. );
  60. VOID
  61. DeinitRasNameMapper(
  62. VOID
  63. );
  64. DWORD
  65. RefreshRasCache(
  66. IN PWCHAR pwszPhonebook,
  67. IN OUT RAS_INFO_TABLE **ppTable
  68. );
  69. DWORD
  70. UpdateRasLookupTable(
  71. IN PRAS_INFO_TABLE pTable
  72. );
  73. PRAS_NODE
  74. LookupRasNodeByGuid(
  75. IN GUID *pGuid
  76. );
  77. PRAS_NODE
  78. LookupRasNodeByName(
  79. IN PWCHAR pwszName
  80. );
  81. DWORD
  82. AddRasNode(
  83. IN LPRASENUMENTRYDETAILS pInfo
  84. );
  85. VOID
  86. RemoveRasNode(
  87. IN PRAS_NODE pNode
  88. );
  89. #endif // __IPHLPAPI_RASMAP__