Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Window Equivalent !! Pin
ThatsAlok30-Mar-05 17:51
ThatsAlok30-Mar-05 17:51 
GeneralCOleDateTime::GetCurrentTime and daylight saving changes Pin
BadJerry29-Mar-05 23:22
BadJerry29-Mar-05 23:22 
GeneralRe: COleDateTime::GetCurrentTime and daylight saving changes Pin
BadJerry30-Mar-05 0:26
BadJerry30-Mar-05 0:26 
GeneralRe: COleDateTime::GetCurrentTime and daylight saving changes Pin
Mike Dimmick30-Mar-05 1:17
Mike Dimmick30-Mar-05 1:17 
GeneralRe: COleDateTime::GetCurrentTime and daylight saving changes Pin
BadJerry30-Mar-05 2:07
BadJerry30-Mar-05 2:07 
QuestionHow to support multi-language Pin
ytod29-Mar-05 23:18
ytod29-Mar-05 23:18 
AnswerRe: How to support multi-language Pin
BadJerry29-Mar-05 23:27
BadJerry29-Mar-05 23:27 
GeneralGetting domain name where a remote computer is attached Pin
Suso29-Mar-05 20:35
Suso29-Mar-05 20:35 
Hi, I need to get the domain name (not the controller domain name) of a remote computer. I'm using NetWkstaGetInfo function and I tried to use it, but I have got problems. This function works correctly when I try to get domain name of local computer but it returns an error when I tried to get information about a remote computer. This is the function code:

BOOL GetDomainName(char *szTerminal, char *szDomain)
{
PWKSTA_INFO_100 pBufferInfo;
NET_API_STATUS err = 0;
DWORD dwBytes;
WCHAR *swzTerminal = NULL;

dwBytes = MultiByteToWideChar(CP_ACP, 0, szTerminal, -1, NULL, 0);

swzTerminal = malloc(dwBytes* sizeof(TCHAR));

dwBytes = MultiByteToWideChar(CP_ACP,
0,
(LPCSTR)szTerminal,
-1,
swzTerminal,
dwBytes);

err = NetWkstaGetInfo((char *)swzTerminal,
(DWORD)100,
(LPBYTE *)&pBufferInfo);
if(err != NERR_Success)
{
return FALSE;
}

WideCharToMultiByte(CP_ACP,
0,
(LPCWSTR)pBufferInfo->wki100_langroup,
-1,
szDomain,
MAX_PATH,
NULL,
NULL);

return TRUE;
}


The returned error is err = 5 (ERROR_ACCESS_DENIED)

I read some Microsoft information about privileges required for executing this function. But I executed the program with an local administrator user in Windows 2K and NT and got the same problem. I just need information about the domain name, not modify anything. Maybe is there a posiblity of querying information with a lower level that don't require administrator privileges.

I've seen some commercial programs (like Dameware) that obtains the domain name just with IP address of remote computer, without establishing any connection (and introducing username and password). I am trying to do the same.

In the NetWkstaGetInfo information appears:

"You must have Print or Server operator privilege, or be a member of the Administrator or Account local groups to successfully execute NetWkstaGetInfo at level 0 or level 1 on a remote server. No special privilege is required for level 10 calls."

How can I do level 10 calls?

Thanks.



QuestionLink one view to an other? Pin
herime29-Mar-05 20:33
herime29-Mar-05 20:33 
GeneralIHTMLDocument2 loading Pin
mlatimer29-Mar-05 19:43
mlatimer29-Mar-05 19:43 
GeneralRe: IHTMLDocument2 loading Pin
mlatimer29-Mar-05 20:07
mlatimer29-Mar-05 20:07 
GeneralCPropertySheet::SetActivePage() Pin
swati2429-Mar-05 19:11
swati2429-Mar-05 19:11 
GeneralRe: CPropertySheet::SetActivePage() Pin
ThatsAlok29-Mar-05 20:08
ThatsAlok29-Mar-05 20:08 
GeneralRe: CPropertySheet::SetActivePage() Pin
Ravi Bhavnani29-Mar-05 20:13
professionalRavi Bhavnani29-Mar-05 20:13 
GeneralRe: CPropertySheet::SetActivePage() Pin
swati2429-Mar-05 20:31
swati2429-Mar-05 20:31 
Generalsb live Pin
nvd229-Mar-05 17:54
nvd229-Mar-05 17:54 
GeneralRe: sb live Pin
Joel Holdsworth29-Mar-05 20:47
Joel Holdsworth29-Mar-05 20:47 
GeneralCalling Forms from Forms Pin
mvtapia29-Mar-05 17:52
mvtapia29-Mar-05 17:52 
GeneralDevice driver compatability between Win95 & Win98 Pin
Neha.marwaha29-Mar-05 16:51
Neha.marwaha29-Mar-05 16:51 
GeneralRe: Device driver compatability between Win95 & Win98 Pin
MMansonFan2529-Mar-05 22:46
MMansonFan2529-Mar-05 22:46 
QuestionCould anyone help me, please? Pin
New Student29-Mar-05 14:37
New Student29-Mar-05 14:37 
QuestionPlease help. Is multimap what I need? Pin
knapak29-Mar-05 12:58
knapak29-Mar-05 12:58 
AnswerRe: Please help. Is multimap what I need? Pin
BadJerry29-Mar-05 23:47
BadJerry29-Mar-05 23:47 
GeneralRe: Please help. Is multimap what I need? Pin
knapak30-Mar-05 10:50
knapak30-Mar-05 10:50 
AnswerRe: Please help. Is multimap what I need? Pin
Blake Miller30-Mar-05 4:23
Blake Miller30-Mar-05 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.