Merge pull request #21 from microsoft/SyncFromInternal
Fix a bug in MSMPILaunchSVC - respect arguments passed in to 'sc create'
This commit is contained in:
Коммит
ae08569e8b
|
@ -30,7 +30,7 @@ private:
|
|||
public:
|
||||
MsmpiLaunchService m_launcher;
|
||||
|
||||
HRESULT Start();
|
||||
HRESULT Start(_In_ DWORD argc, _In_ LPWSTR *argv);
|
||||
|
||||
static WindowsSvc ms_windowsSvc;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ MsmpiLaunchService& Launcher()
|
|||
//
|
||||
// Entry point
|
||||
//
|
||||
int __cdecl main(int /*argc*/, const char* /*argv[]*/)
|
||||
int __cdecl wmain(_In_ DWORD argc, _In_ LPWSTR *argv)
|
||||
{
|
||||
if (!gEventLogger.Open(SERVICE_NAME))
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ int __cdecl main(int /*argc*/, const char* /*argv[]*/)
|
|||
//
|
||||
// Start MsMpi Launch Service
|
||||
//
|
||||
HRESULT result = WindowsSvc::ms_windowsSvc.Start();
|
||||
HRESULT result = WindowsSvc::ms_windowsSvc.Start(argc, argv);
|
||||
|
||||
if (FAILED(result))
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ HRESULT WindowsSvc::ChangeState(_In_ DWORD newState)
|
|||
//
|
||||
// Does service specific initializations and registers service loop and control handlers
|
||||
//
|
||||
HRESULT WindowsSvc::Start()
|
||||
HRESULT WindowsSvc::Start(_In_ DWORD argc, _In_ LPWSTR *argv)
|
||||
{
|
||||
HANDLE processToken;
|
||||
HRESULT result;
|
||||
|
@ -134,6 +134,20 @@ HRESULT WindowsSvc::Start()
|
|||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Parse options
|
||||
//
|
||||
if (!m_launcher.ParseOptions(argc, argv))
|
||||
{
|
||||
gEventLogger.WriteEvent(
|
||||
EVENTLOG_ERROR_TYPE,
|
||||
SVC_CATEGORY,
|
||||
SERVICE_EVENT,
|
||||
L"Error while parsing parameters\n");
|
||||
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
//
|
||||
// Load msmpi service launcher
|
||||
//
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>
|
||||
<AdditionalDependencies>
|
||||
%(AdditionalDependencies);
|
||||
$(PUBLIC_SDK_LIB)\kernel32.lib;
|
||||
|
|
Загрузка…
Ссылка в новой задаче