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.

109 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. Patchbc.h
  5. Abstract:
  6. Public header file for a module used to patch translated messages
  7. into arrays that constitute Windows NT file system and master boot code.
  8. Author:
  9. Ted Miller (tedm) 6 May 1997
  10. Revision History:
  11. --*/
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. /*
  16. Various modules in the Windows NT need to lay the mbr or file system
  17. boot records, such as format, setup, etc. Boot code for fat, fat32,
  18. ntfs, and the mbr is each built into a corresponding header file
  19. in sdk\inc. Each header file has an array of bytes that constitute
  20. the boot code itself. The code has no text in it, but instead has some
  21. placeholders for text that need to be patched in at run-time by
  22. users of those header files. This allows localization of the
  23. boot messages without recompiles.
  24. As built, each boot code array has a WORD in a known place that
  25. indicates where in the array the messages are supposed to start.
  26. In addition the boot code expects to look in that same place to
  27. find the offset of any message it needs. Thus code in this
  28. module reads the value that was built into the array and replaces
  29. it with values of the latter type.
  30. For the file system boot code, the message offset table is located
  31. immediately before the 2-byte 55aa sig (for fat) or the 4-byte 000055aa
  32. sig (for fat32 and ntfs).
  33. Fat/Fat32 share 3 messages, whose offsets are expected to be in the
  34. following order in the offset table:
  35. NTLDR is missing
  36. Disk error
  37. Press any key to restart
  38. NTFS has 4 messages, whose offsets are expected to be in the following
  39. order in the offset table:
  40. A disk read error occurred
  41. NTLDR is missing
  42. NTLDR is compressed
  43. Press Ctrl+Alt+Del to restart
  44. For the master boot code, the message offset table is immediately before
  45. the NTFT signature and has 3 messages (thus it starts at offset 0x1b5).
  46. The offsets are expected to be in the following order:
  47. Invalid partition table
  48. Error loading operating system
  49. Missing operating system
  50. Finally note that to allow one-byte values to be stored in the message
  51. offset tables we store the offset - 256.
  52. The routines below return FALSE if the text is too long to fit in the
  53. available space.
  54. */
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. BOOLEAN
  59. PatchMessagesIntoFatBootCode(
  60. IN OUT PUCHAR BootCode,
  61. IN BOOLEAN IsFat32,
  62. IN LPCSTR MsgNtldrMissing,
  63. IN LPCSTR MsgDiskError,
  64. IN LPCSTR MsgPressKey
  65. );
  66. BOOLEAN
  67. PatchMessagesIntoNtfsBootCode(
  68. IN OUT PUCHAR BootCode,
  69. IN LPCSTR MsgNtldrMissing,
  70. IN LPCSTR MsgNtldrCompressed,
  71. IN LPCSTR MsgDiskError,
  72. IN LPCSTR MsgPressKey
  73. );
  74. BOOLEAN
  75. PatchMessagesIntoMasterBootCode(
  76. IN OUT PUCHAR BootCode,
  77. IN LPCSTR MsgInvalidTable,
  78. IN LPCSTR MsgIoError,
  79. IN LPCSTR MsgMissingOs
  80. );
  81. #ifdef __cplusplus
  82. }
  83. #endif