2025-11-28 00:35:46 +09:00

71 lines
1.2 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//----------------------------------------------------------------------------
//
// Microsoft Active Directory 2.5 Sample Code
//
// Copyright (C) Microsoft Corporation, 1996 - 2000
//
// File: main.cxx
//
// Contents: Main for adscmd
//
//
//----------------------------------------------------------------------------
#include "main.hxx"
//-------------------------------------------------------------------------
//
// main
//
//-------------------------------------------------------------------------
int __cdecl
main(int argc, char * argv[])
{
HRESULT hr;
int exitcode;
if (argc != 3) {
PrintUsage() ;
exit(1);
}
hr = CoInitialize(NULL);
if (FAILED(hr)) {
printf("CoInitialize failed\n");
exit(1);
}
if (_stricmp(argv[1],"list") == 0) {
//
// Call the List helper function
//
exitcode = DoList(argv[2]) ;
}
else if (_stricmp(argv[1],"dump") == 0) {
//
// Call the Dump helper function
//
exitcode = DoDump(argv[2]) ;
}
else {
//
// Unknown command
//
PrintUsage() ;
exitcode = 1 ;
}
CoUninitialize();
exit(exitcode) ;
return 0;
}