[DISKPART] Fix build. Simplify PrintMessageString().

This commit is contained in:
Hermès Bélusca-Maïto 2022-05-30 02:41:31 +02:00
parent c287c08b27
commit ee613a18eb
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 9 additions and 18 deletions

View file

@ -46,6 +46,10 @@ list(APPEND SOURCE
diskpart.h) diskpart.h)
add_executable(diskpart ${SOURCE} diskpart.rc) add_executable(diskpart ${SOURCE} diskpart.rc)
add_pch(diskpart diskpart.h SOURCE)
add_message_headers(UNICODE diskpart_msg.mc)
add_dependencies(diskpart diskpart_msg)
set_module_type(diskpart win32cui UNICODE) set_module_type(diskpart win32cui UNICODE)
target_link_libraries(diskpart conutils ${PSEH_LIB}) target_link_libraries(diskpart conutils ${PSEH_LIB})
add_importlibs(diskpart advapi32 msvcrt kernel32 ntdll) add_importlibs(diskpart advapi32 msvcrt kernel32 ntdll)
@ -54,6 +58,4 @@ if(MSVC)
add_importlibs(diskpart ntdll) add_importlibs(diskpart ntdll)
endif() endif()
add_pch(diskpart diskpart.h SOURCE)
add_message_headers(UNICODE diskpart_msg.mc)
add_cd_file(TARGET diskpart DESTINATION reactos/system32 FOR all) add_cd_file(TARGET diskpart DESTINATION reactos/system32 FOR all)

View file

@ -84,20 +84,9 @@ VOID
PrintMessageString( PrintMessageString(
_In_ DWORD dwMessage) _In_ DWORD dwMessage)
{ {
PWSTR pBuffer; ConMsgPuts(StdOut,
FORMAT_MESSAGE_FROM_HMODULE,
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, //hModuleNetMsg, NULL, //hModuleNetMsg,
dwMessage, dwMessage,
LANG_USER_DEFAULT, LANG_USER_DEFAULT);
(LPWSTR)&pBuffer,
0,
NULL);
if (pBuffer)
{
ConPuts(StdOut, pBuffer);
LocalFree(pBuffer);
pBuffer = NULL;
}
} }