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.

167 lines
5.0 KiB

  1. /*
  2. - nameres.h
  3. -
  4. * Microsoft Internet Phone user interface
  5. * Name Resolution exported header
  6. *
  7. * Revision History:
  8. *
  9. * When Who What
  10. * -------- ------------------ ---------------------------------------
  11. * 11.25.95 Yoram Yaacovi Created
  12. * Sunita Added name service functions and ipa macros
  13. */
  14. #ifndef _NAMERES_H
  15. #define _NAMERES_H
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. //definitions
  20. //external
  21. #define BY_HOST_NAME 1
  22. #define BY_USER_NAME 2
  23. #define MPNS_PROMPT 0x0001
  24. #define MPNS_SHOWDIR 0x0002
  25. #define MPNS_RETURNHTML 0x0004
  26. #define MPNS_GETADDR 0x0008
  27. #define MPNS_SAVE 0x0010
  28. #define MPNS_GETDETAILS 0x0020
  29. #define MPNS_ALLOWSAVE 0x0040
  30. //internal
  31. #define MAXSERVERNAMELEN 256
  32. #define MAXIPAFILESIZE 4096
  33. #define MAXSERVERDLLNAMELEN 256
  34. #define MAXIPALINELEN 512
  35. #define MAXREGISTEREDNAMELEN 256
  36. #define MAXIPAACTIONLEN 16
  37. #define MAXIPAPAIRSPERLINE 3
  38. #define MAXIPARESULTLEN 64
  39. #define MAXSEARCHEXPLEN 256
  40. #define MAXDIRECTORYLEN 1000
  41. #define MAX_IP_ADDRESS_STRING_SIZE 16
  42. #define LITTLE_STRING_BUFFER_SIZE 8
  43. #define MAXUSERINFOSIZE MAXREGISTEREDNAMELEN
  44. // version defines.
  45. #define CURRENT_CLIENT_VERSION "0001"
  46. // keep-alive periods.
  47. #define CLIENT_KEEP_ALIVE_PERIOD 20000 // 20 seconds.
  48. #define SERVER_KEEP_ALIVE_PERIOD 30000 // 30 seconds.
  49. #define LOWER_TIME_LIMIT 1000 // 1 second.
  50. #define UPPER_TIME_LIMIT 900000 // 15 minutes.
  51. //for now we just call in char
  52. #ifdef UNICODE
  53. typedef TCHAR REGISTEREDNAME[MAXREGISTEREDNAMELEN];
  54. #else
  55. typedef char REGISTEREDNAME[MAXREGISTEREDNAMELEN*2];
  56. #endif //!UNICODE
  57. #ifdef UNICODE
  58. typedef struct USERDETAILS{
  59. REGISTEREDNAME szRegName;
  60. TCHAR szFullName[MAXUSERINFOSIZE];
  61. TCHAR szLocation[MAXUSERINFOSIZE];
  62. TCHAR szHostName[MAXUSERINFOSIZE];
  63. TCHAR szEmailName[MAXUSERINFOSIZE];
  64. TCHAR szHomePage[MAXUSERINFOSIZE];
  65. TCHAR szComments[MAXUSERINFOSIZE];
  66. }USERDETAILS, *PUSERDETAILS;
  67. #else
  68. typedef struct USERDETAILS{
  69. REGISTEREDNAME szRegName;
  70. char szFullName[MAXUSERINFOSIZE*2];
  71. char szLocation[MAXUSERINFOSIZE*2];
  72. char szHostName[MAXUSERINFOSIZE*2];
  73. char szEmailName[MAXUSERINFOSIZE*2];
  74. char szHomePage[MAXUSERINFOSIZE*2];
  75. char szComments[MAXUSERINFOSIZE*2];
  76. }USERDETAILS, *PUSERDETAILS;
  77. #endif
  78. typedef struct _CALLEE_ID
  79. {
  80. REGISTEREDNAME strCalleeName;
  81. TCHAR strIPAddress[MAX_IP_ADDRESS_STRING_SIZE + 1];
  82. TCHAR strPort[LITTLE_STRING_BUFFER_SIZE + 1];
  83. TCHAR strAppName[MAX_PATH + 1];
  84. TCHAR strGUID[LITTLE_STRING_BUFFER_SIZE + 1];
  85. }CALLEE_ID;
  86. typedef CALLEE_ID *PCALLEE_ID;
  87. //typedef REGISTEREDNAME *PREGISTEREDNAME,*LPREGISTEREDNAME;
  88. typedef struct _SEARCHCRITERIA{
  89. WORD cbStruct; //size of the struct
  90. }SEARCHCRITERIA;
  91. typedef SEARCHCRITERIA *pSEARCHCRITERIA,*LPSEARCHCRITERIA;
  92. #pragma warning (disable : 4200)
  93. typedef struct _NAMEDIR{
  94. DWORD cbStruct; //size of the struct
  95. DWORD dwNumEntries; //number of entries in the directory
  96. REGISTEREDNAME RegNames[]; //pointer to an array of registerednames
  97. }NAMEDIR,*PNAMEDIR,*LPNAMEDIR;
  98. #pragma warning (default : 4200)
  99. typedef DWORD HNSSESSION;
  100. #define TOKENBEGINCHAR '<'
  101. #define TOKENENDCHAR '>'
  102. #define HEADSTARTSTR "HEAD"
  103. #define HEADENDSTR "/HEAD"
  104. #define URL_SPACE_CHARACTER '.'
  105. //exported functions
  106. typedef HNSSESSION (WINAPI *NAMESERVICEINITIALIZE)(HWND,LPTSTR);
  107. typedef BOOL (WINAPI *NAMESERVICEDEINITIALIZE)(HNSSESSION);
  108. typedef BOOL (WINAPI *NAMESERVICEREGISTER)(HNSSESSION, HWND,LPTSTR);
  109. typedef BOOL (WINAPI *NAMESERVICEUNREGISTER)(HNSSESSION,LPTSTR);
  110. typedef BOOL (WINAPI *NAMESERVICERESOLVE)(HNSSESSION, LPTSTR, DWORD, CALLEE_ID *);
  111. typedef BOOL (WINAPI *NAMESERVICEGETDIRECTORY)(HNSSESSION, HWND, LPSEARCHCRITERIA,
  112. DWORD, LPNAMEDIR *,LPTSTR, PCALLEE_ID);
  113. typedef BOOL (WINAPI *NAMESERVICELOGON)(HNSSESSION, LPTSTR, LPTSTR, LPTSTR,
  114. LPTSTR, LPTSTR, LPTSTR, LPTSTR,
  115. LPTSTR, LPTSTR);
  116. typedef BOOL (WINAPI *NAMESERVICELOGOFF)(HNSSESSION, LPTSTR);
  117. typedef BOOL (WINAPI *CALLEEIDFROMIPABUF)(LPBYTE, DWORD, PCALLEE_ID);
  118. typedef void (WINAPI *NAMESERVICEFREEMEM)(LPVOID);
  119. typedef BOOL (WINAPI *NAMESERVICEUSERDETAILS)(HWND, DWORD, PUSERDETAILS);
  120. //exported function prototypes
  121. extern BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID);
  122. extern HNSSESSION WINAPI NameServiceInitialize(HWND, LPTSTR);
  123. extern BOOL WINAPI NameServiceDeinitialize(HNSSESSION);
  124. extern BOOL WINAPI NameServiceRegister(HNSSESSION, HWND, LPTSTR);
  125. extern BOOL WINAPI NameServiceUnregister(HNSSESSION, LPTSTR);
  126. extern BOOL WINAPI NameServiceLogon(HNSSESSION, LPTSTR, LPTSTR, LPTSTR, LPTSTR,
  127. LPTSTR, LPTSTR, LPTSTR, LPTSTR, LPTSTR);
  128. extern BOOL WINAPI NameServiceLogoff(HNSSESSION, LPTSTR);
  129. extern BOOL WINAPI NameServiceResolve(HNSSESSION, LPTSTR, DWORD, CALLEE_ID *);
  130. extern BOOL WINAPI NameServiceGetDirectory(HNSSESSION, HWND, LPSEARCHCRITERIA,
  131. DWORD, LPNAMEDIR *, LPTSTR, PCALLEE_ID);
  132. extern BOOL WINAPI NameServiceUserDetails(HWND, DWORD, PUSERDETAILS);
  133. extern BOOL WINAPI CalleeIdFromIpaBuf(LPBYTE, DWORD, PCALLEE_ID);
  134. extern void WINAPI NameServiceFreeMem(LPVOID);
  135. #ifdef __cplusplus
  136. }
  137. #endif
  138. #endif //#ifndef _NAMERES_H