Patch by Michael Fritscher <michael@fritscher.net>

Add /? and /s cmdline options

svn path=/trunk/; revision=9657
This commit is contained in:
Gé van Geldorp 2004-06-11 14:10:12 +00:00
parent 58b454b469
commit b2e222b305

View file

@ -671,6 +671,7 @@ int main (int argc, char *argv[])
HKEY hPnpKey;
DWORD dwType;
DWORD dwSize;
BOOL Ask = TRUE;
PCM_FULL_RESOURCE_DESCRIPTOR lpBuffer;
PCM_PNP_BIOS_INSTALLATION_CHECK lpPnpInst;
PCM_PNP_BIOS_DEVICE_NODE lpDevNode;
@ -678,7 +679,21 @@ int main (int argc, char *argv[])
DWORD dwDataSize, dwResourceSize;
hPnpKey = 0;
if (argc >1 && (!strcmp (argv[1],"/S") || !strcmp (argv[1],"/s")))
{
Ask = FALSE;
}
if (argc >1 && !strcmp (argv[1],"/?"))
{
printf ("This utility prints the PnP-nodes from the registry\n");
printf ("\"/s\" prevents the \"Press any key\"\n\n");
return 0;
}
lError = GetPnpKey(&hPnpKey);
if (lError != ERROR_SUCCESS)
{
@ -783,8 +798,15 @@ return 0;
lpDevNode = (PCM_PNP_BIOS_DEVICE_NODE)((DWORD)lpDevNode + lpDevNode->Size);
}
printf ("\n Press any key...\n");
getch();
if (Ask)
{
printf ("\n Press any key...\n");
getch();
}
else
{
printf ("\n");
}
dwDataSize = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK);
lpDevNode = (PCM_PNP_BIOS_DEVICE_NODE)((DWORD)lpPnpInst + sizeof(CM_PNP_BIOS_INSTALLATION_CHECK));
@ -793,9 +815,16 @@ return 0;
{
PrintDeviceData (lpDevNode);
printf ("\n Press any key...\n");
getch();
if (Ask)
{
printf ("\n Press any key...\n");
getch();
}
else
{
printf ("\n");
}
dwDataSize += lpDevNode->Size;
lpDevNode = (PCM_PNP_BIOS_DEVICE_NODE)((DWORD)lpDevNode + lpDevNode->Size);
}