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.

82 lines
2.4 KiB

  1. #include "ldap.hxx"
  2. #pragma hdrstop
  3. FILTERS Filters[] = { { USER_CLASS_NAME, LDAP_USER_ID},
  4. { GROUP_CLASS_NAME, LDAP_GROUP_ID},
  5. { PRINTER_CLASS_NAME, LDAP_PRINTER_ID},
  6. { DOMAIN_CLASS_NAME, LDAP_DOMAIN_ID},
  7. { COMPUTER_CLASS_NAME, LDAP_COMPUTER_ID},
  8. { SERVICE_CLASS_NAME, LDAP_SERVICE_ID},
  9. { FILESERVICE_CLASS_NAME, LDAP_FILESERVICE_ID},
  10. { FILESHARE_CLASS_NAME, LDAP_FILESHARE_ID},
  11. { CLASS_CLASS_NAME, LDAP_CLASS_ID},
  12. { SYNTAX_CLASS_NAME, LDAP_SYNTAX_ID},
  13. { PROPERTY_CLASS_NAME, LDAP_PROPERTY_ID},
  14. { TEXT("Locality"), LDAP_LOCALITY_ID },
  15. { TEXT("Organization"), LDAP_O_ID},
  16. { TEXT("Organizational Unit"), LDAP_OU_ID},
  17. { TEXT("organizationalUnit"), LDAP_OU_ID},
  18. { TEXT("Country"), LDAP_COUNTRY_ID},
  19. { TEXT("localGroup"), LDAP_GROUP_ID},
  20. { TEXT("groupOfNames"), LDAP_GROUP_ID},
  21. { TEXT("groupOfUniqueNames"), LDAP_GROUP_ID},
  22. { TEXT("person"), LDAP_USER_ID},
  23. { TEXT("organizationalPerson"), LDAP_USER_ID},
  24. { TEXT("residentialPerson"), LDAP_USER_ID},
  25. { TEXT("inetOrgPerson"), LDAP_USER_ID}
  26. };
  27. #define MAX_FILTERS (sizeof(Filters)/sizeof(FILTERS))
  28. PFILTERS gpFilters = Filters;
  29. DWORD gdwMaxFilters = MAX_FILTERS;
  30. HRESULT
  31. BuildADsGuid(
  32. REFCLSID clsid,
  33. BSTR *pADsClass
  34. )
  35. {
  36. HRESULT hr = S_OK;
  37. TCHAR ADsClass[MAX_PATH];
  38. if (!StringFromGUID2(clsid, ADsClass, MAX_PATH)) {
  39. //
  40. // MAX_PATH should be more than enough for the GUID.
  41. //
  42. ADsAssert(!"GUID too big !!!");
  43. RRETURN(E_FAIL);
  44. }
  45. RRETURN(ADsAllocString( ADsClass, pADsClass));
  46. }
  47. HRESULT
  48. MakeUncName(
  49. LPTSTR szSrcBuffer,
  50. LPTSTR szTargBuffer
  51. )
  52. {
  53. ADsAssert(szSrcBuffer && *szSrcBuffer);
  54. _tcscpy(szTargBuffer, TEXT("\\\\"));
  55. _tcscat(szTargBuffer, szSrcBuffer);
  56. RRETURN(S_OK);
  57. }
  58. HRESULT
  59. ValidateOutParameter(
  60. BSTR * retval
  61. )
  62. {
  63. if (!retval) {
  64. RRETURN(E_ADS_BAD_PARAMETER);
  65. }
  66. RRETURN(S_OK);
  67. }