Article ID: 185725
Article Last Modified on 10/29/2003
HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ ServiceProvider\Order\Once you have created this key, there will be the following default string pair:
(Default)=(value not set)
(Default)=""
#include <stdio.h>
#include <winsock2.h>
#include <nspapi.h>
#include <svcguid.h>
#include <wsipx.h>
int main (int argc, char **argv)
{
WSADATA WSAData;
INT protocols[1],
i,
err;
char buffer[2048];
DWORD bytesRequired;
SOCKET s;
LPSTR ServiceTypeName=NULL;
char szServerName[100];
PCSADDR_INFO csaddrInfo;
if (WSAStartup( MAKEWORD(2,0), &WSAData))
{
printf( "WSAStartup error\n" );
return -1;
}
GUID ServiceType = SVCID_FILE_SERVER;
/*
* Service Name advertised on NetWare server
*/
ServiceTypeName = argv[1];
protocols[0] = NSPROTO_IPX;
bytesRequired = sizeof(buffer);
err = GetAddressByName(
NS_SAP,
&ServiceType,
ServiceTypeName,
protocols,
RES_SOFT_SEARCH,
NULL,
buffer,
&bytesRequired,
NULL,
NULL
);
if (err < 0)
{
err = GetLastError();
printf("GetAddressByName error: %d\n", err);
return 1;
}
else if (err == 0)
{
printf("GetAddressByName: no service found.\n");
return 1;
}
WSACleanup()
return 0;
}
Additional query words: Netware GetAddressByName
Keywords: kbwinsock kbapi kbnetwork kbprb kbpending KB185725