Exemplo n.º 1
0
/****************************************************************************
REMARKS:
Get the name of the machine on the network.
****************************************************************************/
const char * PMAPI PM_getMachineName(void)
{
    static char name[256];

    if (REG_queryString(szMachineNameKey,szMachineName,name,sizeof(name)))
        return name;
    if (REG_queryString(szMachineNameKeyNT,szMachineName,name,sizeof(name)))
        return name;
    return "UNKNOWN";
}
Exemplo n.º 2
0
/****************************************************************************
REMARKS:
Function to retrieve the system path for the OS. If we try to access the
registry during the early boot phase of the system
****************************************************************************/
static void PMAPI PM_getSystemRoot(
    char *path,
    int len)
{
    if (!REG_queryString(szNTWindowsKey,szNTSystemRoot,path,len)) {
        // Really early in the boot sequence the registry may not be
        // available, so we have no way to find the root of the
        // filesystem. In fact when this is the case we can't even
        // access the file system anyway, so I am not dealing with
        // solving this problem at the moment.
        strcpy(path,"c:\\winnt");
        }
}
Exemplo n.º 3
0
/****************************************************************************
REMARKS:
Internal function to determine if the system has been booted or is presently
in the boot phase. We use a back door hack to determine this by checking
to see if we can access the registry for the NT system root key. If this
fails, then we know the system is booting as a partial registry is only
available for some parts of the boot sequence.
****************************************************************************/
ibool PMAPI PM_isSystemBooted(void)
{
    char path[256];
    return REG_queryString(szNTWindowsKey,szNTSystemRoot,path,sizeof(path));
}