49 while (Utf8Buffer[
i++] && (
i < 3));
55 Utf8Buffer[0] = Utf8Buffer[1];
56 Utf8Buffer[1] = Utf8Buffer[2];
57 Utf8Buffer[2] = Utf8Char;
62 Utf8Buffer[
i] = Utf8Char;
73 if (!(Utf8Char & 0x80))
77 *Utf8Value = (
WCHAR)Utf8Char;
78 Utf8Buffer[0] = Utf8Buffer[1];
79 Utf8Buffer[1] = Utf8Buffer[2];
101 while ((*SourceBuffer) &&
103 (*ProcessedCount < SourceBufferLength))
105 if (*SourceBuffer & 0xFF80)
107 if (*SourceBuffer & 0xF800)
110 DestinationBuffer[*UTF8Count] = ((*SourceBuffer >> 12) & 0xF) | 0xE0;
112 DestinationBuffer[*UTF8Count] = ((*SourceBuffer >> 6) & 0x3F) | 0x80;
117 DestinationBuffer[*UTF8Count] = ((*SourceBuffer >> 6) & 31) | 0xC0;
120 DestinationBuffer[*UTF8Count] = (*SourceBuffer & 0x3F) | 0x80;
124 DestinationBuffer[*UTF8Count] = (*SourceBuffer & 0x7F);
132 ASSERT(*ProcessedCount <= SourceBufferLength);
150 if (MessageEntry->
Index == MessageIndex)
153 MessageData = MessageEntry->
Buffer;
167 ULONG ProcessedCount, Utf8Count,
i;
179 for (
i = 0;
i < Utf8Count;
i++)
209 if (!(MessageString) || !(FormattedString) || !(MessageSize))
216 while ((MessageString[0]) && (MessageSize))
219 if (MessageString[0] !=
L'%')
222 *FormattedString++ = MessageString[0];
228 switch (MessageString[1])
235 *FormattedString++ =
L'%';
239 *FormattedString++ =
L'\r';
240 *FormattedString++ =
L'\n';
244 *FormattedString++ =
L'\r';
248 *FormattedString++ =
L' ';
252 *FormattedString++ =
L'.';
256 *FormattedString++ =
L'!';
355 TextSize = MessageEntry->
Length -
576 Size +=
wcslen(
L"<processor-architecture>%s</processor-architecture>\r\n");
584 Size +=
wcslen(
L"<os-version>%s</os-version>\r\n");
592 Size +=
wcslen(
L"<os-build-number>%s</os-build-number>\r\n");
600 Size +=
wcslen(
L"<os-product>%s</os-product>\r\n");
608 Size +=
wcslen(
L"<os-service-pack>%s</os-service-pack>\r\n");
632 L"<name>%s</name>\r\n",
639 L"<guid>%s</guid>\r\n",
646 L"<processor-architecture>%s</processor-architecture>\r\n",
653 L"<os-version>%s</os-version>\r\n",
660 L"<os-build-number>%s</os-build-number>\r\n",
667 L"<os-product>%s</os-product>\r\n",
674 L"<os-service-pack>%s</os-service-pack>\r\n",
697 ULONG SuiteTypeMessage;
708 SAC_DBG(
SAC_DBG_MACHINE,
"SAC Initialize Machine Information:: MachineInformationBuffer already initialized.\n");
724 RtlZeroMemory(&VersionInformation,
sizeof(VersionInformation));
735 L"SystemSetupInProgress",
745 MessageBuffer =
GetMessage(SAC_UNINITIALIZED_MSG);
761 if (!SetupInProgress)
765 L"CurrentControlSet\\Control\\"
766 L"ComputerName\\ComputerName",
791 OutputSize =
sizeof(SystemGuid);
813 L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
824 SystemGuid.Data4[7]);
830 L"CurrentControlSet\\Control\\"
831 L"Session Manager\\Environment",
832 L"PROCESSOR_ARCHITECTURE",
843 ProcessorArchitecture,
883 SuiteTypeMessage = SAC_DATACENTER_SUITE_MSG;
887 SuiteTypeMessage = SAC_EMBEDDED_SUITE_MSG;
891 SuiteTypeMessage = SAC_ENTERPRISE_SUITE_MSG;
896 SuiteTypeMessage = SAC_NO_SUITE_MSG;
917 SAC_DBG(
SAC_DBG_INIT,
"SAC InitializeMachineInformation: Failed product type memory allocation.\n");
945 SAC_DBG(
SAC_DBG_INIT,
"SAC InitializeMachineInformation: Failed service pack memory allocation.\n");
967 SAC_DBG(
SAC_DBG_INIT,
"SAC InitializeMachineInformation: Failed service pack memory allocation.\n");
989 L"DisableCmdSessions",
1119 HeaderLength =
strlen(
"MACHINEINFO");
1235 ULONG LineCount = 0;
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
NTSTATUS TranslateMachineInformationText(IN PWCHAR Buffer)
ULONG GlobalMessageTableCount
NTSTATUS NTAPI UTF8EncodeAndSend(IN PWCHAR String)
BOOLEAN IsCmdEventRegistrationProcess(IN PFILE_OBJECT FileObject)
BOOLEAN NTAPI VerifyEventWaitable(IN HANDLE Handle, OUT PVOID *WaitObject, OUT PVOID *ActualWaitObject)
NTSTATUS NTAPI ImposeSacCmdServiceStartTypePolicy(VOID)
NTSTATUS NTAPI CopyRegistryValueData(IN PVOID *Buffer, IN PKEY_VALUE_PARTIAL_INFORMATION PartialInfo)
PSAC_MACHINE_INFO MachineInformation
NTSTATUS CopyAndInsertStringAtInterval(IN PWCHAR SourceStr, IN ULONG Interval, IN PWCHAR InsertStr, OUT PWCHAR pDestStr)
ULONG Utf8ConversionBufferSize
VOID NTAPI SacFormatMessage(IN PWCHAR FormattedString, IN PWCHAR MessageString, IN ULONG MessageSize)
PKEVENT RequestSacCmdFailureEventWaitObjectBody
PVOID RequestSacCmdSuccessEventObjectBody
NTSTATUS NTAPI PreloadGlobalMessageTable(IN PVOID ImageBase)
LONG SerialPortProducerIndex
NTSTATUS NTAPI RegisterBlueScreenMachineInformation(VOID)
BOOLEAN NTAPI SacTranslateUtf8ToUnicode(IN CHAR Utf8Char, IN PCHAR Utf8Buffer, OUT PWCHAR Utf8Value)
VOID NTAPI FreeMachineInformation(VOID)
PFILE_OBJECT ServiceProcessFileObject
LONG SerialPortConsumerIndex
BOOLEAN NTAPI SacTranslateUnicodeToUtf8(IN PWCHAR SourceBuffer, IN ULONG SourceBufferLength, OUT PCHAR DestinationBuffer, IN ULONG DestinationBufferSize, OUT PULONG UTF8Count, OUT PULONG ProcessedCount)
PSAC_MESSAGE_ENTRY GlobalMessageTable
ULONG NTAPI GetMessageLineCount(IN ULONG MessageIndex)
PVOID RequestSacCmdEventObjectBody
NTSTATUS InvokeUserModeService(VOID)
NTSTATUS NTAPI GetCommandConsoleLaunchingPermission(OUT PBOOLEAN Permission)
PVOID RequestSacCmdFailureEventObjectBody
VOID NTAPI InitializeMachineInformation(VOID)
VOID NTAPI InitializeCmdEventInfo(VOID)
PCHAR Utf8ConversionBuffer
NTSTATUS NTAPI GetRegistryValueBuffer(IN PCWSTR KeyName, IN PWCHAR ValueName, IN PKEY_VALUE_PARTIAL_INFORMATION *Buffer)
PKEVENT RequestSacCmdSuccessEventWaitObjectBody
NTSTATUS RegisterSacCmdEvent(IN PVOID Object, IN PKEVENT SetupCmdEvent[])
NTSTATUS NTAPI SetRegistryValue(IN PCWSTR KeyName, IN PWCHAR ValueName, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
BOOLEAN HaveUserModeServiceCmdEventInfo
ULONG ConvertAnsiToUnicode(IN PWCHAR pwch, IN PCHAR pch, IN ULONG length)
NTSTATUS NTAPI SerialBufferGetChar(OUT PCHAR Char)
PKEVENT RequestSacCmdEventWaitObjectBody
NTSTATUS NTAPI TearDownGlobalMessageTable(VOID)
NTSTATUS NTAPI TranslateMachineInformationXML(IN PWCHAR *Buffer, IN PWCHAR ExtraData)
NTSTATUS UnregisterSacCmdEvent(IN PFILE_OBJECT FileObject)
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
@ HeadlessCmdSetBlueScreenData
NTSTATUS NTAPI HeadlessDispatch(IN HEADLESS_CMD Command, IN PVOID InputBuffer, IN SIZE_T InputBufferSize, OUT PVOID OutputBuffer, OUT PSIZE_T OutputBufferSize)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
#define InitializeObjectAttributes(p, n, a, r, s)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define OBJECT_TO_OBJECT_HEADER(o)
_Out_ _Inout_ POEM_STRING DestinationString
NTSYSAPI NTSTATUS NTAPI RtlFindMessage(_In_ PVOID BaseAddress, _In_ ULONG Type, _In_ ULONG Language, _In_ ULONG MessageId, _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry)
#define MESSAGE_RESOURCE_UNICODE
@ KeyValuePartialInformation
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
BOOLEAN NTAPI ExVerifySuite(SUITE_TYPE SuiteType)
#define STATUS_NOT_IMPLEMENTED
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
#define CHECK_PARAMETER2(x)
#define SacAllocatePool(Length, Tag)
#define CHECK_PARAMETER1(x)
#define CHECK_PARAMETER_WITH_STATUS(Condition, Status)
#define CHECK_PARAMETER4(x)
#define SAC_DBG_ENTRY_EXIT
#define SAC_SERIAL_PORT_BUFFER_SIZE
struct _SAC_MESSAGE_ENTRY SAC_MESSAGE_ENTRY
#define SacFreePool(Pointer)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_In_ DWORD _Out_ PDWORD _In_opt_ PCSTR MachineName
UCHAR Data[ANYSIZE_ARRAY]
UCHAR Text[ANYSIZE_ARRAY]
ULONG dwOSVersionInfoSize
PWCHAR ProcessorArchitecture
_In_ ULONG _In_ ULONG _In_ ULONG DestinationBufferSize
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_NO_DATA_DETECTED
#define STATUS_OBJECT_NAME_NOT_FOUND
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
#define ObDereferenceObject