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.

71 lines
1.4 KiB

  1. /*
  2. * csinst.cxx
  3. Author: DebiM
  4. This is a tool to install an empty Class Repository for a NTDS DC.
  5. This needs to be run after a successful NTDS installation.
  6. It creates an empty repository in the domain.
  7. */
  8. #include "ole2int.h"
  9. #include <rpc.h>
  10. #include "cstore.h"
  11. //dsbase.hxx"
  12. //+---------------------------------------------------------------------------
  13. //
  14. // Function: main
  15. //
  16. // History: 10-22-96 DebiM Created
  17. //
  18. //----------------------------------------------------------------------------
  19. void _cdecl main( int argc, char ** argv)
  20. {
  21. HRESULT hr;
  22. WCHAR szPath [_MAX_PATH + 1];
  23. hr = CoInitialize(NULL);
  24. if ( FAILED(hr) )
  25. {
  26. printf( "CoInitialize failed(%x)\n", hr );
  27. return;
  28. }
  29. if (argc == 2)
  30. {
  31. //
  32. // Use the path for the container passed as parameter
  33. //
  34. MultiByteToWideChar (CP_ACP, 0, argv [1], strlen (argv[1]) + 1, szPath, _MAX_PATH);
  35. hr = CsCreateClassStore(szPath);
  36. }
  37. else
  38. {
  39. printf( "Usage is >> csinst <Class Store Path>\n");
  40. CoUninitialize();
  41. return;
  42. }
  43. if (FAILED(hr))
  44. {
  45. printf( "Failed to create repository - %S. Error - 0x%x\n",
  46. szPath, hr);
  47. }
  48. else
  49. {
  50. printf( "Created Repository at - %S.\n",
  51. szPath);
  52. }
  53. CoUninitialize();
  54. return;
  55. }