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.

93 lines
1.7 KiB

  1. #include "oleds.hxx"
  2. #pragma hdrstop
  3. //+------------------------------------------------------------------------
  4. //
  5. // Class: Common
  6. //
  7. // Purpose: Contains Router routines and properties that are common to
  8. // all Router objects. Router objects get the routines and
  9. // properties through C++ inheritance.
  10. //
  11. //-------------------------------------------------------------------------
  12. //+------------------------------------------------------------------------
  13. //
  14. // Function: BuildADsPath
  15. //
  16. // Synopsis: Returns the ADs path for Router Objects. Note that there
  17. // is *** ONLY ONE *** Router Object and that is the Namespaces
  18. // Object.
  19. // The ADsPath for the Namespaces Object is the same as its
  20. // Name -- L"ADs:"
  21. //
  22. // Arguments: [Parent] - is NULL and ignored
  23. // [Name] - is L"ADs:"
  24. // [pADsPath] - pointer to a BSTR
  25. //
  26. // Returns: HRESULT
  27. //
  28. //-------------------------------------------------------------------------
  29. HRESULT
  30. BuildADsPath(
  31. BSTR Parent,
  32. BSTR Name,
  33. BSTR *pADsPath
  34. )
  35. {
  36. HRESULT hr = S_OK;
  37. ADsAssert(pADsPath);
  38. hr = ADsAllocString(Name, pADsPath);
  39. RRETURN(hr);
  40. }
  41. HRESULT
  42. BuildADsGuid(
  43. REFCLSID clsid,
  44. BSTR *pADsClass
  45. )
  46. {
  47. WCHAR ADsClass[MAX_PATH];
  48. if (!StringFromGUID2(clsid, ADsClass, MAX_PATH)) {
  49. //
  50. // MAX_PATH should be more than enough for the GUID.
  51. //
  52. ADsAssert(!"GUID too big !!!");
  53. RRETURN(E_FAIL);
  54. }
  55. RRETURN(ADsAllocString(ADsClass, pADsClass));
  56. }
  57. HRESULT
  58. ValidateOutParameter(
  59. BSTR * retval
  60. )
  61. {
  62. if (!retval) {
  63. RRETURN(E_ADS_BAD_PARAMETER);
  64. }
  65. RRETURN(S_OK);
  66. }