QueryDosDevice enumerator
By: a guest | Mar 20th, 2010 | Syntax:
C | Size: 0.85 KB | Hits: 298 | Expires: Never
#include <stdio.h>
#include <windows.h>
void main()
{
char szDosDevs[32768];
char szSymbol[8192];
char *pszDos;
char *pszSymbol;
// get all dos device names separated by 0's
//
QueryDosDevice(NULL, szDosDevs, 32768);
pszDos = szDosDevs;
// loop through the set of dos names
//
while (*pszDos)
{
printf("%-15s", pszDos); // write the dos name
// get the translation of the dos name to the
// NT device name(s).
//
QueryDosDevice(pszDos, szSymbol, 8192);
pszSymbol = szSymbol;
// print each of the names on a separate line
// names are separated in the szSymbol buffer
// by '0's
//
while (*pszSymbol)
{
printf("\t%s\n", pszSymbol);
pszSymbol += strlen(pszSymbol) + 1;
break;
}
pszDos += strlen(pszDos) + 1;
}
return;
}