Path: blob/main/crypto/krb5/src/windows/leashdll/winerr.c
34914 views
/* WINERR.C12Jason Hunter38/2/944DCNS/IS MIT567Contains the error functions for leash and kerberos. Prints out keen windows8error messages in english.910*/1112#include <stdio.h>1314// Private Include files15#include "leashdll.h"16#include <leashwin.h>1718// Global Variables.19static long lsh_errno;20static char *err_context; /* error context */21extern int (*Lcom_err)(LPSTR,long,LPSTR,...);22extern LPSTR (*Lerror_message)(long);23extern LPSTR (*Lerror_table_name)(long);2425#ifdef WIN1626#define UNDERSCORE "_"27#else28#define UNDERSCORE29#endif3031HWND GetRootParent (HWND Child)32{33HWND Last;34while (Child)35{36Last = Child;37Child = GetParent (Child);38}39return Last;40}414243LPSTR err_describe(LPSTR buf, long code)44{45LPSTR cp, com_err_msg;46int offset;47long table_num;48char *etype;4950offset = (int) (code & 255);51table_num = code - offset;52com_err_msg = Lerror_message(code);5354lstrcpy(buf, com_err_msg);55return buf;565758////Is this needed at all after the return above?59cp = buf;60if(com_err_msg != buf)61lstrcpy(buf, com_err_msg);62cp = buf + lstrlen(buf);63*cp++ = '\n';64etype = Lerror_table_name(table_num);65wsprintf((LPSTR) cp, (LPSTR) "(%s error %d"66#ifdef DEBUG_COM_ERR67" (absolute error %ld)"68#endif69")", etype, offset70//")\nPress F1 for help on this error.", etype, offset71#ifdef DEBUG_COM_ERR72, code73#endif74);7576return (LPSTR)buf;77}787980