Module: wine Branch: master Commit: fefae9ca78fdcfc5c789a8ab9007191c9b9f7cc3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fefae9ca78fdcfc5c789a8ab90...
Author: Hugh McMaster hugh.mcmaster@outlook.com Date: Sun Dec 3 06:50:16 2017 +0000
reg: Export the registry file header.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/reg/export.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/programs/reg/export.c b/programs/reg/export.c index 81ffd22..d34878b 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -26,6 +26,22 @@
WINE_DEFAULT_DEBUG_CHANNEL(reg);
+static void write_file(HANDLE hFile, const WCHAR *str) +{ + DWORD written; + + WriteFile(hFile, str, lstrlenW(str) * sizeof(WCHAR), &written, NULL); +} + +static void export_file_header(HANDLE hFile) +{ + static const WCHAR header[] = { 0xfeff,'W','i','n','d','o','w','s',' ', + 'R','e','g','i','s','t','r','y',' ','E','d','i','t','o','r',' ', + 'V','e','r','s','i','o','n',' ','5','.','0','0','\r','\n'}; + + write_file(hFile, header); +} + static HANDLE create_file(const WCHAR *filename, DWORD action) { return CreateFileW(filename, GENERIC_WRITE, 0, NULL, action, FILE_ATTRIBUTE_NORMAL, NULL); @@ -98,6 +114,7 @@ int reg_export(int argc, WCHAR *argv[]) }
hFile = get_file_handle(argv[3], overwrite_file); + export_file_header(hFile); FIXME(": operation not yet implemented\n"); CloseHandle(hFile);