home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************/
- /* File: GETNWSN.C */
- /* */
- /* Function: Output the current servers serial and application */
- /* numbers. */
- /* */
- /* Usage: getnwsn */
- /* */
- /* Functions Called: GetNetworkSerialNumber */
- /* GetPreferredConnectionID */
- /* GetDefaultConnectionID */
- /* GetPrimaryConnectionID */
- /* SetPreferredConnectionID */
- /* ISShellLoaded */
- /* */
- /***************************************************************************/
-
- #include "netware.h"
- #include <stdio.h>
-
- void main(void)
- {
- dword serialnumber;
- word appnumber;
- int rcode;
- int thisserver,prefserver;
-
- if (IsShellLoaded() != SUCCESS)
- {
- printf("*** No netware shell loaded ***\n");
- return;
- }
-
- if ((prefserver = GetPreferredConnectionID()) == 0)
- {
- if ((thisserver = GetDefaultConnectionID()) == 0)
- thisserver = GetPrimaryConnectionID();
- SetPreferredConnectionID( thisserver );
- }
- else
- thisserver = prefserver;
-
- rcode=GetNetworkSerialNumber( &serialnumber,&appnumber );
- if (rcode != 0)
- printf("GetNetworkSerialNumber failed:%d\n",rcode);
- else
- {
- printf("\nServer Serial Number: 0x%08.8lx\n",serialnumber);
- printf( " Application Number: 0x%04.4x\n\n",appnumber);
- }
-
- if (thisserver != prefserver) /* reset preferred server */
- SetPreferredConnectionID( prefserver );
-
- return;
- }
-
-