Radim Picha (EliCZ) <apihooks com seznam cz> |
Tuesday, February 19 2008 05:29.16 CST |
Our Win32 (service) process was starting too late, sometimes even after explorer.exe. We had to find a way to start the process sooner. Winlogon notifies are no longer supported and AppInit_DLLs is not a good solution. Here is the result.
|
Nice trick with custom subsystem ;) |
Just as a curiosity - did you look at some form of MS GINA pass-through module? One that would not necessarily authenticate, but would be certain to run?
Very interesting solution nonetheless.
|
aeppert,
MSDN: GINA DLLs are ignored in Windows Vista
+ KB925519 + no winwlx.h in WDK + no winlogon.exe in session 0 since NT6.
This all was meant by "Winlogon notifies are no longer supported".
|
Ah, amazing what happens when one's reading comprehension fetches the proverbial clue.
Thanks for the clarification. I have not looked at Vista at all to be quite honest, so that little tidbit will certainly help me when I get around to it! |
|
Verrry intersting solution. Thanks for sharing! ;> |
Interesting...
But have you try to establish a dependency with a common service? (for example add a dependendy to RPC service with your ASAP service).
I don't try it perhaps it's not a clean solution because a update can disable the dependency. |
Interesting article.....but
But o solution based on a native application would run much earlier that this because such a native application starts before the windows session manager process (smss.exe). Because smss.exe starts every subsystem process you will run a lot earlier from such a native application.
cheers! |
Aram,
you are absolutely right, all you can do (I think) is just wait (seems you can't even use eventlog apis that early) and maybe you will miss something from service mechanism (notifies?).
mcimpoesu,
yes, if you are able to rewrite the whole thing to Nt native
you win. If you have (old) big (more programmers) project and it's written for Win32 you will not rewrite it + not whole registry is initialized in bootexecute time(!). Native application doesn't start before smss.exe - it's run from smss.exe but before (~ not "much earlier") required subsystems. My first attempt was a small Nt app that waits for Win32 server and then spawns Win32 app but that was too complicated. I wanted to know how is winlogon/winit.exe (= InitialCommand) spawned when it is Win32 app && it's parent is smss.exe - in other words I was trying to find a way to run/register win32 process from native process (there is SmpExecPgm function in smss).
The blog entry was about running _Win32_ app ASAP not about running user-mode code ASAP.
|
ok, I got it now, you need a big application and is not possible to run it on native mode :)
As for the registry you can initialize them by hand using NtInitializeRegistry (if I can remember right) doing the same job as smss.exe does |
|