Novell is now a part of Micro Focus

We're new to this Novell stuff, but we...

Articles and Tips: qna

01 Feb 2003


Q.

We're new to this Novell stuff, but we want our program, when running on a workstation that someone has logged onto with the Novell client, to figure out what server they were authenticated against (I assume this is known as the "NDS server").

When it gets to NWDSGetServerAddresses2, it returns FFFFFECD. I can retrieve tree names and such, and NWDSWhoAmI works, but I can't figure out how to get there from here. I assume the "connection handle" is allowed to be 0 if someone has successfully logged into a server?

A.

No, connection 0 is invalid from a workstation. Connection 0 is a special NLM server-side connection only. The following program will list all your current connections:

#include <stdio.h>
#include <nwcalls.h>
#include <nwclxcon.h>
void main(void)
{
	NWCCODE cCode;
	NWRCODE scanCode = 0;
	nuint32 scanIterator = 0;
	NWCCConnInfo connInfoBuf;
	nuint32 connRef;
cCode = NWCallsInit(NULL,NULL);
	if(cCode)
	{
		printf("NWCallsInit returned :%04X", cCode);
		return;
	}
scanCode = 0;
	scanIterator = 0;
while(scanCode != NWE_NO_MORE_ENTRIES)
	{
		scanCode = NWCCScanConnRefs(&scanIterator, &connRef);
			if(scanCode && scanCode != NWE_NO_MORE_ENTRIES)
			{
				printf("NWCCScanConnRefs returned :%04X", cCode);
				return;
			}
if (scanCode!=0) break;
cCode = NWCCGetAllConnRefInfo(connRef, NWCC_INFO_VERSION_1, &connInfoBuf);
		if (cCode == NWE_NO_MORE_ENTRIES)
		{
			printf("NWCCGetAllConnRefInfo returned :%04X", cCode);
			return;
		}
printf("\nServer Name: %s", connInfoBuf.serverName);
		printf("\nTree Name: %s", connInfoBuf.treeName);
		printf("\nConn Number: %d", connInfoBuf.connNum);
	}
}

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates