[ros-diffs] [ekohl] 20382: Report a logged-on user to the PnP-Manager.

ekohl at svn.reactos.com ekohl at svn.reactos.com
Wed Dec 28 00:05:28 CET 2005


Report a logged-on user to the PnP-Manager.
This should trigger the driver installation.
Modified: trunk/reactos/subsys/system/userinit/userinit.c
  _____  

Modified: trunk/reactos/subsys/system/userinit/userinit.c
--- trunk/reactos/subsys/system/userinit/userinit.c	2005-12-27
22:28:45 UTC (rev 20381)
+++ trunk/reactos/subsys/system/userinit/userinit.c	2005-12-27
23:05:22 UTC (rev 20382)
@@ -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 at users.sourceforge.net)
  */
 #include <windows.h>
+#include <cfgmgr32.h>
 #include "resource.h"
 
 
@@ -142,16 +142,38 @@
   }
 }
 
+
+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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051228/8b8a73be/attachment.html


More information about the Ros-diffs mailing list