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.

37 lines
743 B

  1. #include "stdafx.h"
  2. #include <windows.h>
  3. #include <sapi.h>
  4. #include <atlbase.h>
  5. #include <spdebug.h>
  6. #include "sapiint.h"
  7. #include <assertwithstack.cpp>
  8. extern "C" int WINAPI WinMain(
  9. HINSTANCE hInstance,
  10. HINSTANCE hPrevInstance,
  11. LPTSTR lpCmdLine,
  12. int nShowCmd)
  13. {
  14. SPDBG_FUNC("WinMain");
  15. HRESULT hr;
  16. SPDBG_DEBUG_SERVER_ON_START();
  17. hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
  18. if (SUCCEEDED(hr))
  19. {
  20. CComPtr<ISpSapiServer> cpSapiServer;
  21. hr = cpSapiServer.CoCreateInstance(CLSID_SpSapiServer);
  22. if (SUCCEEDED(hr))
  23. {
  24. hr = cpSapiServer->Run();
  25. }
  26. }
  27. CoUninitialize();
  28. SPDBG_REPORT_ON_FAIL(hr);
  29. return SUCCEEDED(hr) ? 0 : hr;
  30. }