|
|
1.1 ! root 1: /****************************************************************************\ ! 2: * dstrerr.c -- sample program demonstrating NWLink. ! 3: * ! 4: * Microsoft Developer Support ! 5: * Copyright (c) 1992, 1993 Microsoft Corporation ! 6: * ! 7: * Demonstrates basic sockets programming with the Windows Sockets API ! 8: * using the NWLink transport. ! 9: * ! 10: ****************************************************************************/ ! 11: #include <windows.h> ! 12: #include <winsock.h> ! 13: #include <stdio.h> ! 14: #include "externs.h" ! 15: ! 16: /**************************************************************************** ! 17: * ! 18: * FUNCTION: dos_net_strerror( LPSTR p ) ! 19: * ! 20: * PURPOSE: This will return an far char * to an error message ! 21: * string preceded by the user string passed in and ! 22: * seperated by a :. The user string cannot be more ! 23: * than xx bytes in length. ! 24: * ! 25: * ARGUMENTS: LPSTR => user string to print first ! 26: * ! 27: * RETURNS: LPCSTR => user string + error string ! 28: * ! 29: *\***************************************************************************/ ! 30: LPCSTR dos_net_strerror(LPSTR p) ! 31: { ! 32: int error = 0; ! 33: static char return_string[256]; ! 34: ! 35: /* ! 36: * Get the error number from the system ! 37: */ ! 38: ! 39: error = h_errno; ! 40: ! 41: /* ! 42: * Build the string to return ! 43: */ ! 44: ! 45: sprintf(return_string, "%s :(%d)%s", p, error, get_error_text(error)); ! 46: ! 47: return (LPSTR)return_string; ! 48: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.