CMP_WaitNoPendingInstallEvents

  • Thread starter Thread starter Perro Flaco
  • Start date Start date
P

Perro Flaco

Hi!

Maybe this is not the best place to ask this, but I haven't found
anything better. Sorry for any inconvenient.

I've read in this group that you can use
"CMP_WaitNoPendingInstallEvents" to wait until all drivers are loading
and initializing. I've tried to use it in my C++ program, but without
any success. I get a lot of errors, even after including "cfgmgr32.h".
I'm using Visual 2005. Any advice?

Thanks very much for your help!
 
Hello Perro,

In your namespace include:
++++++++++++++++++++++++++
[DllImport("cfgmgr32.dll", EntryPoint = "CMP_WaitNoPendingInstallEvents",
CharSet = Unicode)]
DWORD CM_WaitNoPendingInstallEvents(DWORD);
public __gc __interface IProcessInitializer;
++++++++++++++++++++++++++
somewhere in your Program (e.g. a timer) you can call:
++++++++++++++++++++++++++
switch (FirstReboot::CM_WaitNoPendingInstallEvents(dwTimeout))
{
case WAIT_OBJECT_0:
//Form1::Text = S"There are no pending installation activities";
break;
case WAIT_TIMEOUT :
//Form1::Text = S"The time-out interval elapsed, and installation activities
are still pending";
break;
case WAIT_FAILED :
//Form1::Text = S"The function failed. Call GetLastError for additional
error information.";
break;
++++++++++++++++++++++++++

Don't forget that the function can return true for a short duration despite
pending installation processes.
Best to test the function with an uninstalled USB-Stick.

Regards, Wolfgang

P.S. EntryPoint= CMP_... Function is CM_...
 
Back
Top