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.

88 lines
1.7 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996
  5. //
  6. // File: util.hxx
  7. //
  8. // Contents: Some misc helper functions
  9. //
  10. // History:
  11. //----------------------------------------------------------------------------
  12. #define ARRAY_SIZE(_a) (sizeof(_a) / sizeof(_a[0]))
  13. #define GET_BASE_CLASS(a,n) (_tcsicmp(a[n-1],TEXT("Top")) == 0? a[0] : a[n-1])
  14. extern SEARCHENTRY g_aSyntaxSearchTable[], g_aOidSyntaxSearchTable[];
  15. extern DWORD g_nSyntaxSearchTableSize, g_nOidSyntaxSearchTableSize;
  16. typedef struct _KEYDATA {
  17. DWORD cTokens;
  18. LPWSTR pTokens[1];
  19. } KEYDATA, *PKEYDATA;
  20. PKEYDATA
  21. CreateTokenList(
  22. LPWSTR pKeyData,
  23. WCHAR ch
  24. );
  25. DWORD
  26. GetSyntaxOfAttribute(
  27. LPWSTR pszAttrName,
  28. SCHEMAINFO *pSchemaInfo
  29. );
  30. DWORD
  31. LdapGetSyntaxIdFromName(
  32. LPWSTR pszSyntax
  33. );
  34. HRESULT
  35. UnMarshallLDAPToLDAPSynID(
  36. LPWSTR pszAttrName,
  37. ADS_LDP *ld,
  38. LDAPMessage *entry,
  39. DWORD dwSyntax,
  40. LDAPOBJECTARRAY *pldapObjectArray
  41. );
  42. extern "C"
  43. ADSTYPE
  44. MapLDAPTypeToADSType(
  45. DWORD dwLdapType
  46. );
  47. extern "C"
  48. DWORD
  49. MapADSTypeToLDAPType(
  50. ADSTYPE dwAdsType
  51. );
  52. #if 0
  53. // ADsGetSearchPreference code
  54. HRESULT
  55. ConstructSearchPrefArray(
  56. PLDAP_SEARCH_PREF pPrefs,
  57. PADS_SEARCHPREF_INFO pADsSearchPref,
  58. PBYTE pbExtraBytes
  59. );
  60. HRESULT
  61. CalcSpaceForSearchPrefs(
  62. PLDAP_SEARCH_PREF pPrefs,
  63. PDWORD pdwNumberPrefs,
  64. PDWORD pdwNumberExtraBytes
  65. );
  66. HRESULT
  67. IsSearchPrefSetToDefault(
  68. ADS_SEARCHPREF_ENUM pref,
  69. PLDAP_SEARCH_PREF pPrefs,
  70. PBOOL pfDefault
  71. );
  72. #endif