Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.4 KiB

  1. /* msghdr.c -- Message code - replacement for nmsghdr.asm fmsghdr.asm
  2. **
  3. ** microsoft (r) macro assembler
  4. ** copyright (c) microsoft corp 1986. all rights reserved
  5. **
  6. ** Note: This module is only used for FLATMODEL versions of masm
  7. ** __NMSG_TEXT is used whenever segments are allowed.
  8. **
  9. ** Jeff Spencer 10/90
  10. */
  11. #include <stdio.h>
  12. #include "asm86.h"
  13. #include "asmfcn.h"
  14. #include "asmmsg.h"
  15. /* Used by asmmsg2.h */
  16. struct Message {
  17. USHORT usNum; /* Message number */
  18. UCHAR *pszMsg; /* Message pointer */
  19. };
  20. #include "asmmsg2.h"
  21. UCHAR * GetMsgText( USHORT, USHORT );
  22. /* Performs same function as internal C library function __NMSG_TEXT */
  23. /* Only the C library function uses segments, and a different data */
  24. /* format */
  25. UCHAR NEAR * PASCAL
  26. NMsgText(
  27. USHORT messagenum
  28. ){
  29. return( (UCHAR NEAR *)GetMsgText( messagenum, 0 ) );
  30. }
  31. /* Same functionality as internal C library function __FMSG_TEXT */
  32. /* Only the C library function uses segments, and a different data */
  33. /* format */
  34. UCHAR FAR * PASCAL
  35. FMsgText(
  36. USHORT messagenum
  37. ){
  38. return( (UCHAR FAR *)GetMsgText( messagenum, 1 ) );
  39. }
  40. UCHAR *
  41. GetMsgText(
  42. USHORT messagenum,
  43. USHORT tablenum
  44. ){
  45. struct Message *pMsg;
  46. pMsg = ( tablenum ) ? FAR_MSG_tbl : MSG_tbl;
  47. while( pMsg->usNum != ER_ENDOFLIST ){
  48. if( pMsg->usNum == messagenum ){
  49. return( pMsg->pszMsg );
  50. }
  51. pMsg++;
  52. }
  53. return( (UCHAR *)0 );
  54. }