svn path=/trunk/; revision=13413

This commit is contained in:
Eric Kohl 2005-02-05 00:20:14 +00:00
parent b70985ca99
commit 2b921cb3e3
6 changed files with 185 additions and 3 deletions

View file

@ -105,8 +105,7 @@ SYS_APPS = autochk calc cmd explorer expand format ibrowser msiexec regedt32 reg
winlogon regedit winefile notepad reactos
# System services
# rpcss eventlog
SYS_SVC = rpcss eventlog
SYS_SVC = rpcss eventlog umpnpmgr
APPS = testsets utils

View file

@ -201,6 +201,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\ServiceGroupOrder","List",0x00010000, \
"NDIS", \
"PNP_TDI", \
"TDI", \
"PlugPlay", \
"Extended Base"
; Group order, the first DWORD is the count of entries,
@ -676,6 +677,13 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Pice","Type",0x00010001,0x00000001
;HKLM,"SYSTEM\CurrentControlSet\Services\ntice","Start",0x00010001,0x00000000
;HKLM,"SYSTEM\CurrentControlSet\Services\ntice","Type",0x00010001,0x00000001
; Plug and Play manager
HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Group",0x00000000,"PlugPlay"
HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","ImagePath",0x00020000,"%SystemRoot%\system32\umpnpmgr.exe"
HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Start",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Type",0x00010001,0x00000010
; PS/2 mouse port driver
HKLM,"SYSTEM\CurrentControlSet\Services\Psaux","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Psaux","Group",0x00000000,"Pointer Port"

View file

@ -161,8 +161,9 @@ subsys\system\winlogon\winlogon.exe 1
subsys\system\winefile\winefile.exe 1
services\eventlog\eventlog.exe 1
services\rpcss\rpcss.exe 1
services\umpnpmgr\umpnpmgr.exe 1
apps\utils\net\arp\arp.exe 1
apps\utils\net\route\route.exe 1
apps\utils\net\route\route.exe 1
apps\utils\net\finger\finger.exe 1
apps\utils\net\ftp\ftp.exe 1
apps\utils\net\ipconfig\ipconfig.exe 1

View file

@ -0,0 +1,23 @@
# $Id$
PATH_TO_TOP = ../..
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = umpnpmgr
TARGET_INSTALLDIR = system32
TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a rpcrt4.a
TARGET_OBJECTS = umpnpmgr.o
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View file

@ -0,0 +1,147 @@
/*
* ReactOS kernel
* Copyright (C) 2005 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: services/umpnpmgr/umpnpmgr.c
* PURPOSE: User-mode Plug and Play manager
* PROGRAMMER: Eric Kohl
*/
/* INCLUDES *****************************************************************/
#define UNICODE
#define _UNICODE
#define NTOS_MODE_USER
#include <ntos.h>
#include <ntos/ntpnp.h>
#include <ddk/wdmguid.h>
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <rpc.h>
#include <rpcdce.h>
#define DBG
#define NDEBUG
#include <debug.h>
/* GLOBALS ******************************************************************/
static VOID CALLBACK
ServiceMain(DWORD argc, LPTSTR *argv);
static SERVICE_TABLE_ENTRY ServiceTable[2] =
{
{_T("PlugPlay"), ServiceMain},
{NULL, NULL}
};
/* FUNCTIONS *****************************************************************/
static DWORD WINAPI
PnpEventThread(LPVOID lpParameter)
{
PPLUGPLAY_EVENT_BLOCK PnpEvent;
NTSTATUS Status;
RPC_STATUS RpcStatus;
PnpEvent = HeapAlloc(GetProcessHeap(), 0, 1024);
if (PnpEvent == NULL)
return ERROR_OUTOFMEMORY;
for (;;)
{
DPRINT("Calling NtGetPlugPlayEvent()\n");
ZeroMemory(PnpEvent, 1024);
/* Wait for the next pnp event */
Status = NtGetPlugPlayEvent(0, 0, PnpEvent, 1024);
if (!NT_SUCCESS(Status))
{
DPRINT("NtPlugPlayEvent() failed (Status %lx)\n", Status);
break;
}
DPRINT("Received PnP Event\n");
if (UuidEqual((UUID*)&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ARRIVAL, &RpcStatus))
{
DPRINT1("Device arrival event: %S\n", PnpEvent->TargetDevice.DeviceIds);
}
else
{
DPRINT1("Unknown event\n");
}
/* FIXME: Process the pnp event */
/* Dequeue the current pnp event and signal the next one */
NtPlugPlayControl(PLUGPLAY_USER_RESPONSE, NULL, 0);
}
HeapFree(GetProcessHeap(), 0, PnpEvent);
return ERROR_SUCCESS;
}
static VOID CALLBACK
ServiceMain(DWORD argc, LPTSTR *argv)
{
HANDLE hThread;
DWORD dwThreadId;
DPRINT("ServiceMain() called\n");
hThread = CreateThread(NULL,
0,
PnpEventThread,
NULL,
0,
&dwThreadId);
if (hThread != NULL)
CloseHandle(hThread);
DPRINT("ServiceMain() done\n");
}
int
main(int argc, char *argv[])
{
DPRINT("Umpnpmgr: main() started\n");
StartServiceCtrlDispatcher(ServiceTable);
DPRINT("Umpnpmgr: main() done\n");
ExitThread(0);
return 0;
}
/* EOF */

View file

@ -0,0 +1,4 @@
#define REACTOS_STR_FILE_DESCRIPTION "User-Mode Plug and Play manager\0"
#define REACTOS_STR_INTERNAL_NAME "Umpnpmgr\0"
#define REACTOS_STR_ORIGINAL_FILENAME "Umpnpmgr.exe\0"
#include <reactos/version.rc>