From 24010280210e6e45bb87d804db0e0d22ba82bf27 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 27 Dec 2005 23:05:22 +0000 Subject: [PATCH] Report a logged-on user to the PnP-Manager. This should trigger the driver installation. svn path=/trunk/; revision=20382 --- reactos/subsys/system/userinit/userinit.c | 32 +++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/system/userinit/userinit.c b/reactos/subsys/system/userinit/userinit.c index 7aed8d252b7..f631a2013fb 100644 --- a/reactos/subsys/system/userinit/userinit.c +++ b/reactos/subsys/system/userinit/userinit.c @@ -16,14 +16,14 @@ * 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 Userinit Logon Application * FILE: subsys/system/userinit/userinit.c * PROGRAMMERS: Thomas Weidenmueller (w3seek@users.sourceforge.net) */ #include +#include #include "resource.h" @@ -142,16 +142,38 @@ void SetUserSettings(void) } } + +typedef DWORD (WINAPI *PCMP_REPORT_LOGON)(DWORD, DWORD); + +static VOID +NotifyLogon(VOID) +{ + HINSTANCE hModule; + PCMP_REPORT_LOGON CMP_Report_LogOn; + + hModule = LoadLibrary(L"setupapi.dll"); + if (hModule) + { + CMP_Report_LogOn = (PCMP_REPORT_LOGON)GetProcAddress(hModule, "CMP_Report_LogOn"); + if (CMP_Report_LogOn) + CMP_Report_LogOn(CMP_MAGIC, GetCurrentProcessId()); + + FreeLibrary(hModule); + } +} + + #ifdef _MSC_VER #pragma warning(disable : 4100) #endif /* _MSC_VER */ int WINAPI WinMain(HINSTANCE hInst, - HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, - int nCmdShow) + HINSTANCE hPrevInstance, + LPSTR lpszCmdLine, + int nCmdShow) { + NotifyLogon(); SetUserSettings(); StartShell(); return 0;