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.

161 lines
5.0 KiB

  1. /* ----------------------------------------------------------------------
  2. Module: ULS.DLL (Service Provider)
  3. File: spinc.h
  4. Content: This file contains general definition for service provider.
  5. History:
  6. 10/15/96 Chu, Lon-Chan [lonchanc]
  7. Created.
  8. Copyright (c) Microsoft Corporation 1996-1997
  9. ---------------------------------------------------------------------- */
  10. #ifndef _SPINC_H_
  11. #define _SPINC_H_
  12. #include <windows.h>
  13. #include <winsock.h>
  14. #define LDAP_UNICODE 0
  15. #include "winldap.h"
  16. #define ANY_IN_USER 0
  17. #include "spserver.h"
  18. #include "ulsldap.h"
  19. #include "uls.h"
  20. // Timers
  21. //
  22. #define ID_TIMER_POLL_RESULT 1
  23. #define KEEP_ALIVE_TIMER_BASE 100 // 100 -- 4196
  24. #define CONN_PURGE_TIMER_BASE 10 // 10 and above
  25. // Limits
  26. //
  27. #define INTEGER_STRING_LENGTH 16
  28. #define MAX_DN_LENGTH 512
  29. // General invalid IDs
  30. //
  31. #define INVALID_MSG_ID ((ULONG) -1) // same as ldap_****()
  32. #define INVALID_NOTIFY_ID ((ULONG) -1)
  33. // Global enums
  34. //
  35. typedef enum
  36. {
  37. ILS_REG_STATUS_NONE,
  38. ILS_REG_STATUS_LOCALLY,
  39. ILS_REG_STATUS_REMOTELY
  40. }
  41. REG_STATUS;
  42. // Extended attributes' cache for names/values lists
  43. //
  44. typedef struct
  45. {
  46. ULONG cAttrsToAdd;
  47. TCHAR *pszAttrsToAdd;
  48. ULONG cAttrsToModify;
  49. TCHAR *pszAttrsToModify;
  50. ULONG cAttrsToRemove;
  51. TCHAR *pszAttrsToRemove;
  52. }
  53. ANY_ATTRS;
  54. // Service provider header files
  55. //
  56. extern TCHAR *g_pszUserPrefix;
  57. extern TCHAR *g_pszMtgPrefix;
  58. #include "spconn.h"
  59. #include "spclient.h"
  60. #include "splprot.h"
  61. #include "splmtg.h"
  62. #include "sppqueue.h"
  63. #include "sputils.h"
  64. #include "spserver.h"
  65. // ldapsp.cpp
  66. //
  67. extern HINSTANCE g_hInstance;
  68. extern HWND g_hWndHidden;
  69. extern HWND g_hWndNotify;
  70. extern DWORD g_dwReqThreadID;
  71. extern ULONG g_uRespID;
  72. extern DWORD g_dwClientSig;
  73. // spils.cpp
  74. //
  75. extern const TCHAR c_szModOp[];
  76. extern ULONG g_cbUserPrefix;
  77. extern TCHAR *g_pszUserPrefix;
  78. extern ULONG g_cbMtgPrefix;
  79. extern TCHAR *g_pszMtgPrefix;
  80. extern TCHAR c_szModOp_AddApp[];
  81. extern TCHAR c_szModOp_DeleteApp[];
  82. extern TCHAR c_szModOp_ModifyUser[];
  83. extern TCHAR c_szModOp_ModifyApp[];
  84. enum
  85. {
  86. ISBU_MODOP_ADD_APP,
  87. ISBU_MODOP_DELETE_APP,
  88. ISBU_MODOP_MODIFY_USER,
  89. ISBU_MODOP_MODIFY_APP
  90. };
  91. HRESULT IlsInitialize ( VOID );
  92. HRESULT IlsCleanup ( VOID );
  93. ULONG IlsCalcModifyListSize ( ULONG cAttrs );
  94. LDAPMod *IlsGetModifyListMod ( LDAPMod ***pppMod, ULONG cAttrs, LONG AttrIdx );
  95. VOID IlsFillModifyListItem ( LDAPMod *pMod, TCHAR *pszAttrName, TCHAR *pszAttrValue );
  96. VOID IlsFillModifyListForAnyAttrs ( LDAPMod *apMod[], ULONG *puIndex, ANY_ATTRS *pAnyAttrs );
  97. VOID IlsFixUpModOp ( LDAPMod *pMod, LONG LdapModOp, LONG IsbuModOp );
  98. HRESULT IlsParseRefreshPeriod ( LDAP *ld, LDAPMessage *pLdapMsg, const TCHAR *pszTtlAttrName, ULONG *puTTL );
  99. HRESULT IlsUpdateOneAttr ( SERVER_INFO *pServerInfo, TCHAR *pszDN, TCHAR *pszAttrName, TCHAR *pszAttrValue, LONG nModifyMagic, ULONG cPrefix, TCHAR *pszPrefix, SP_CSession **ppSession, ULONG *puMsgID );
  100. HRESULT IlsUpdateIPAddress ( SERVER_INFO *pServerInfo, TCHAR *pszDN, TCHAR *pszIPAddrName, TCHAR *pszIPAddrValue, LONG nModifyMagic, ULONG cPrefix, TCHAR *pszPrefix );
  101. HRESULT IlsSendRefreshMsg ( SERVER_INFO *pServerInfo, TCHAR *pszBaseDN, TCHAR *pszTTL, TCHAR *pszRefreshFilter, ULONG *puTTL );
  102. HRESULT IlsFillDefStdAttrsModArr ( LDAPMod ***pppMod, DWORD dwFlags, ULONG cMaxAttrs, ULONG *pcTotal, LONG IsbuModOp, ULONG cPrefix, TCHAR *pszPrefix );
  103. const TCHAR *IlsSkipAnyAttrNamePrefix ( const TCHAR *pszAttrName );
  104. const TCHAR *IlsIsAnyAttrName ( const TCHAR *pszAttrName );
  105. TCHAR *IlsPrefixNameValueArray ( BOOL fPair, ULONG cAttrs, const TCHAR *pszAttrs );
  106. TCHAR *IlsBuildDN ( TCHAR *pszBaseDN, TCHAR *pszC, TCHAR *pszO, TCHAR *pszCN, TCHAR *pszObjectClass );
  107. HRESULT IlsCreateAnyAttrsPrefix ( ANY_ATTRS *pAnyAttrs );
  108. VOID IlsReleaseAnyAttrsPrefix ( ANY_ATTRS *pAnyAttrs );
  109. TCHAR **my_ldap_get_values ( LDAP *ld, LDAPMessage *pEntry, TCHAR *pszRetAttrName );
  110. ULONG my_ldap_count_1st_entry_attributes ( LDAP *ld, LDAPMessage *pLdapMsg );
  111. // spnotify.cpp
  112. //
  113. ULONG GetUniqueNotifyID ( VOID );
  114. // spfilter.cpp
  115. //
  116. TCHAR *ClntCreateRefreshFilter ( TCHAR *pszClientName );
  117. TCHAR *MtgCreateRefreshFilter ( TCHAR *pszMtgName );
  118. // TCHAR *ClntCreateEnumFilter ( VOID );
  119. TCHAR *ProtCreateEnumFilter ( TCHAR *pszUserName, TCHAR *pszAppName );
  120. TCHAR *ClntCreateResolveFilter ( TCHAR *pszClientName, TCHAR *pszAppName, TCHAR *pszProtName );
  121. TCHAR *ProtCreateResolveFilter ( TCHAR *pszUserName, TCHAR *pszAppName, TCHAR *pszProtName );
  122. TCHAR *MtgCreateResolveFilter ( TCHAR *pszMtgName );
  123. TCHAR *MtgCreateEnumMembersFilter ( TCHAR *pszMtgName );
  124. // sputils.cpp
  125. //
  126. enum
  127. {
  128. THREAD_WAIT_FOR_EXIT,
  129. THREAD_WAIT_FOR_REQUEST,
  130. NUM_THREAD_WAIT_FOR,
  131. };
  132. extern BOOL g_fExitNow;
  133. extern HANDLE g_ahThreadWaitFor[NUM_THREAD_WAIT_FOR];
  134. #define g_hevExitReqThread g_ahThreadWaitFor[THREAD_WAIT_FOR_EXIT]
  135. #define g_hevNewRequest g_ahThreadWaitFor[THREAD_WAIT_FOR_REQUEST]
  136. #define g_hevReqThreadHasExited g_ahThreadWaitFor[NUM_THREAD_WAIT_FOR]
  137. DWORD WINAPI ReqThread ( VOID *lParam );
  138. BOOL MyCreateWindow ( VOID );
  139. VOID _MyAssert ( BOOL fAssertion );
  140. HRESULT LdapError2Hresult ( ULONG );
  141. HRESULT GetLocalIPAddress ( DWORD *pdwIPAddress );
  142. #endif // _SPINC_H_