Free Source Code and Program Tips
How to Get the Primary Domain name
In gina, the system will list the domain name of the current system. How to get the primary domain name in your program?
From the released the Windows2000 and NT source code, you can get the code of gina. It locate on \win2k\private\windows\gina\winlogon\usrpro.c.
Here is the code:
DWORD rc;
PWSTR PrimaryDomain;
rc = NetGetJoinInformation (
NULL,
&PrimaryDomain,
&Type
);
if (rc != ERROR_SUCCESS)
{
PrimaryDomain = NULL;
}
else
{
wprintf(TEXT(“PrimaryDomain : %s\n”),PrimaryDomain);
}
| Print article | This entry was posted by support on January 3, 2007 at 3:28 am, and is filed under General. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |