标签:ref flow stack over net \n c++ sdn comment
#include <Windows.h>
#include <DSRole.h>
#pragma comment(lib, "netapi32.lib")
#include <stdio.h>
int main(int argc, char ** argv)
{
DSROLE_PRIMARY_DOMAIN_INFO_BASIC * info;
DWORD dw;
dw = DsRoleGetPrimaryDomainInformation(NULL,
DsRolePrimaryDomainInfoBasic,
(PBYTE *)&info);
if (dw != ERROR_SUCCESS)
{
wprintf(L"DsRoleGetPrimaryDomainInformation: %u\n", dw);
return dw;
}
if (info->DomainNameDns == NULL)
{
wprintf(L"DomainNameDns is NULL\n");
}
else
{
wprintf(L"DomainNameDns: %s\n", info->DomainNameDns);
}
return 0;
}
【转】:https://blog.csdn.net/licheng2345738/article/details/79847772
https://stackoverflow.com/questions/9792411/how-to-get-windows-domain-name
标签:ref flow stack over net \n c++ sdn comment
原文地址:https://www.cnblogs.com/hshy/p/10888882.html