8 Contains the error functions for leash and kerberos. Prints out keen windows
9 error messages in english.
16 // Private Include files
21 static long lsh_errno;
22 static char *err_context; /* error context */
23 extern int (*Lcom_err)(LPSTR,long,LPSTR,...);
24 extern LPSTR (*Lerror_message)(long);
25 extern LPSTR (*Lerror_table_name)(long);
28 #define UNDERSCORE "_"
33 HWND GetRootParent (HWND Child)
39 Child = GetParent (Child);
45 LPSTR err_describe(LPSTR buf, long code)
47 LPSTR cp, com_err_msg;
52 offset = (int) (code & 255);
53 table_num = code - offset;
54 com_err_msg = Lerror_message(code);
56 lstrcpy(buf, com_err_msg);
60 ////Is this needed at all after the return above?
62 if(com_err_msg != buf)
63 lstrcpy(buf, com_err_msg);
64 cp = buf + lstrlen(buf);
66 etype = Lerror_table_name(table_num);
67 wsprintf((LPSTR) cp, (LPSTR) "(%s error %d"
69 " (absolute error %ld)"
72 //")\nPress F1 for help on this error.", etype, offset
81 int _export lsh_com_err_proc (LPSTR whoami, long code,
82 LPSTR fmt, va_list args)
84 #ifdef USE_MESSAGE_BOX
87 char buf[1024], *cp; /* changed to 512 by jms 8/23/93 */
88 WORD mbformat = MB_OK | MB_ICONEXCLAMATION;
91 memset(buf, '\0', sizeof(buf));
96 err_describe(buf, code);
103 if (fmt[0] == '%' && fmt[1] == 'b')
106 mbformat = va_arg(args, WORD);
107 /* if the first arg is a %b, we use it for the message
115 wvsprintf((LPSTR)cp, fmt, args);
117 hOldFocus = GetFocus();
118 retval = MessageBox(/*GetRootParent(hOldFocus)*/NULL, buf, whoami,
119 mbformat | MB_ICONHAND | MB_TASKMODAL);
124 #endif /* USE_MESSAGE_BOX */