File:  [WindowsNT SDKs] / mstools / samples / nwlink / testlib / dstrerr.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:24:35 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-nov-1993, ntsdk-jul-1993, HEAD
Microsoft Windows NT Build 511 (SDK Final Release) 07-24-1993

/****************************************************************************\
*  dstrerr.c -- sample program demonstrating NWLink.
*
*       Microsoft Developer Support
*       Copyright (c) 1992, 1993 Microsoft Corporation
*
*  Demonstrates basic sockets programming with the Windows Sockets API
*  using the NWLink transport.
* 
****************************************************************************/
#include <windows.h>
#include <winsock.h>
#include <stdio.h>
#include "externs.h"

/****************************************************************************
*
*    FUNCTION:  dos_net_strerror( LPSTR p )
*
*    PURPOSE:   This will return an far char * to an error message 
*               string preceded by the user string passed in and 
*               seperated by a :.  The user string cannot be more 
*               than xx bytes in length. 
*
*    ARGUMENTS:	LPSTR	=> user string to print first
*
*	 RETURNS:   LPCSTR  => user string + error string
*
*\***************************************************************************/
LPCSTR dos_net_strerror(LPSTR p)
{
    int error = 0;
    static char return_string[256];

    /*
    *   Get the error number from the system 
    */
    
    error = h_errno;

    /*
    *   Build the string to return 
    */

    sprintf(return_string, "%s :(%d)%s", p, error, get_error_text(error));

    return (LPSTR)return_string;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.