Author: pschweitzer
Date: Sun Feb 15 17:19:57 2015
New Revision: 66295
URL:
http://svn.reactos.org/svn/reactos?rev=66295&view=rev
Log:
[WMISVC]
Add a stub for the "Windows Management Infrastructure" service.
This helps the Intel PRO eth card installer to go a bit farther
Added:
trunk/reactos/base/services/wmisvc/
trunk/reactos/base/services/wmisvc/CMakeLists.txt (with props)
trunk/reactos/base/services/wmisvc/wmisvc.c (with props)
trunk/reactos/base/services/wmisvc/wmisvc.rc (with props)
trunk/reactos/base/services/wmisvc/wmisvc.spec (with props)
Modified:
trunk/reactos/base/services/CMakeLists.txt
trunk/reactos/boot/bootdata/hivesft.inf
trunk/reactos/boot/bootdata/hivesys.inf
Modified: trunk/reactos/base/services/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/CMakeLists.t…
==============================================================================
--- trunk/reactos/base/services/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/services/CMakeLists.txt [iso-8859-1] Sun Feb 15 17:19:57 2015
@@ -10,3 +10,4 @@
add_subdirectory(thmsvc)
add_subdirectory(umpnpmgr)
add_subdirectory(wlansvc)
+add_subdirectory(wmisvc)
Added: trunk/reactos/base/services/wmisvc/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/wmisvc/CMake…
==============================================================================
--- trunk/reactos/base/services/wmisvc/CMakeLists.txt (added)
+++ trunk/reactos/base/services/wmisvc/CMakeLists.txt [iso-8859-1] Sun Feb 15 17:19:57
2015
@@ -0,0 +1,10 @@
+spec2def(wmisvc.dll wmisvc.spec ADD_IMPORTLIB)
+
+add_library(wmisvc SHARED
+ wmisvc.c
+ wmisvc.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/wmisvc.def)
+
+set_module_type(wmisvc win32dll UNICODE)
+add_importlibs(wmisvc advapi32 msvcrt kernel32 ntdll)
+add_cd_file(TARGET wmisvc DESTINATION reactos/system32/wbem FOR all)
Propchange: trunk/reactos/base/services/wmisvc/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/wmisvc/wmisvc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/wmisvc/wmisv…
==============================================================================
--- trunk/reactos/base/services/wmisvc/wmisvc.c (added)
+++ trunk/reactos/base/services/wmisvc/wmisvc.c [iso-8859-1] Sun Feb 15 17:19:57 2015
@@ -0,0 +1,157 @@
+/*
+ * ReactOS Services
+ * Copyright (C) 2015 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Services
+ * FILE: base/services/wmisvc/wmisvc.c
+ * PURPOSE: WMI service
+ * PROGRAMMER: Pierre Schweitzer
+ */
+
+/* INCLUDES *****************************************************************/
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#include <stdarg.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
+#include <winsvc.h>
+
+#define NDEBUG
+#include <debug.h>
+
+/* GLOBALS ******************************************************************/
+
+static WCHAR ServiceName[] = L"winmgmt";
+
+static SERVICE_STATUS_HANDLE ServiceStatusHandle;
+static SERVICE_STATUS ServiceStatus;
+
+/* FUNCTIONS *****************************************************************/
+
+static VOID
+UpdateServiceStatus(DWORD dwState)
+{
+ ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ ServiceStatus.dwCurrentState = dwState;
+ ServiceStatus.dwControlsAccepted = 0;
+ ServiceStatus.dwWin32ExitCode = 0;
+ ServiceStatus.dwServiceSpecificExitCode = 0;
+ ServiceStatus.dwCheckPoint = 0;
+
+ if (dwState == SERVICE_START_PENDING ||
+ dwState == SERVICE_STOP_PENDING ||
+ dwState == SERVICE_PAUSE_PENDING ||
+ dwState == SERVICE_CONTINUE_PENDING)
+ ServiceStatus.dwWaitHint = 10000;
+ else
+ ServiceStatus.dwWaitHint = 0;
+
+ SetServiceStatus(ServiceStatusHandle,
+ &ServiceStatus);
+}
+
+static DWORD WINAPI
+ServiceControlHandler(DWORD dwControl,
+ DWORD dwEventType,
+ LPVOID lpEventData,
+ LPVOID lpContext)
+{
+ DPRINT1("ServiceControlHandler() called\n");
+
+ switch (dwControl)
+ {
+ case SERVICE_CONTROL_STOP:
+ DPRINT1(" SERVICE_CONTROL_STOP received\n");
+ UpdateServiceStatus(SERVICE_STOPPED);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_PAUSE:
+ DPRINT1(" SERVICE_CONTROL_PAUSE received\n");
+ UpdateServiceStatus(SERVICE_PAUSED);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_CONTINUE:
+ DPRINT1(" SERVICE_CONTROL_CONTINUE received\n");
+ UpdateServiceStatus(SERVICE_RUNNING);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_INTERROGATE:
+ DPRINT1(" SERVICE_CONTROL_INTERROGATE received\n");
+ SetServiceStatus(ServiceStatusHandle,
+ &ServiceStatus);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_SHUTDOWN:
+ DPRINT1(" SERVICE_CONTROL_SHUTDOWN received\n");
+ UpdateServiceStatus(SERVICE_STOPPED);
+ return ERROR_SUCCESS;
+
+ default :
+ DPRINT1(" Control %lu received\n");
+ return ERROR_CALL_NOT_IMPLEMENTED;
+ }
+}
+
+VOID WINAPI
+ServiceMain(DWORD argc, LPTSTR *argv)
+{
+ UNREFERENCED_PARAMETER(argc);
+ UNREFERENCED_PARAMETER(argv);
+
+ DPRINT1("ServiceMain() called\n");
+
+ ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
+ ServiceControlHandler,
+ NULL);
+ if (!ServiceStatusHandle)
+ {
+ DPRINT1("RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n",
GetLastError());
+ return;
+ }
+
+ UpdateServiceStatus(SERVICE_RUNNING);
+
+ do
+ {
+ Sleep(1);
+ } while (1);
+
+ UpdateServiceStatus(SERVICE_STOPPED);
+}
+
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
+}
Propchange: trunk/reactos/base/services/wmisvc/wmisvc.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/wmisvc/wmisvc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/wmisvc/wmisv…
==============================================================================
--- trunk/reactos/base/services/wmisvc/wmisvc.rc (added)
+++ trunk/reactos/base/services/wmisvc/wmisvc.rc [iso-8859-1] Sun Feb 15 17:19:57 2015
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "WMI Service"
+#define REACTOS_STR_INTERNAL_NAME "wmisvc"
+#define REACTOS_STR_ORIGINAL_FILENAME "wmisvc.dll"
+#include <reactos/version.rc>
Propchange: trunk/reactos/base/services/wmisvc/wmisvc.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/wmisvc/wmisvc.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/wmisvc/wmisv…
==============================================================================
--- trunk/reactos/base/services/wmisvc/wmisvc.spec (added)
+++ trunk/reactos/base/services/wmisvc/wmisvc.spec [iso-8859-1] Sun Feb 15 17:19:57 2015
@@ -0,0 +1 @@
+@ stdcall ServiceMain(long ptr)
Propchange: trunk/reactos/base/services/wmisvc/wmisvc.spec
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/boot/bootdata/hivesft.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Sun Feb 15 17:19:57 2015
@@ -1591,7 +1591,7 @@
; SvcHost services
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SvcHost","DcomLaunch",0x00010000,"PlugPlay"
-HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS",winmgmt"
; Win32 config
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012
Modified: trunk/reactos/boot/bootdata/hivesys.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] Sun Feb 15 17:19:57 2015
@@ -1943,6 +1943,17 @@
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Start",0x00010001,0x00000003
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Type",0x00010001,0x00000020
+; WMI service
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","DisplayName",0x00000000,"ReactOS
Management Infrastructure"
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Description",0x00000000,"Provides
interface to system management information"
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Group",0x00000000,"WMI"
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe
-k netsvcs"
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","ObjectName",0x00000000,"LocalSystem"
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Start",0x00010001,0x00000002
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Type",0x00010001,0x00000020
+HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\wbem\wmisvc.dll"
+
; Sound Blaster (NT4)
;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","Description",0x00000000,"Sound
Blaster (NT4)"
;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","ErrorControl",0x00010001,0x00000001