Added patch to make sure Notepad creates new files immediately.

This commit is contained in:
Sebastian Lackner
2015-08-22 22:01:24 +02:00
parent d7da67b4de
commit cd3a07933a
5 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
From 391fff4e34db1ea266bf5abcfffb81f0ce127eb7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 22 Aug 2015 21:59:22 +0200
Subject: notepad: Make sure new files are created immediately.
---
programs/notepad/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/programs/notepad/main.c b/programs/notepad/main.c
index 480f866..20e887b 100644
--- a/programs/notepad/main.c
+++ b/programs/notepad/main.c
@@ -702,9 +702,18 @@ static void HandleCommandLine(LPWSTR cmdline)
{
switch (AlertFileDoesNotExist(file_name)) {
case IDYES:
+ {
+
+ HANDLE file;
SetFileNameAndEncoding(file_name, ENCODING_ANSI);
+
+ file = CreateFileW(file_name, GENERIC_WRITE, FILE_SHARE_WRITE,
+ NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (file != INVALID_HANDLE_VALUE) CloseHandle(file);
+
UpdateWindowCaption();
break;
+ }
case IDNO:
break;
--
2.5.0

View File

@@ -0,0 +1 @@
Fixes: [19425] Notepad should create new files immediately

View File

@@ -159,6 +159,7 @@ patch_enable_all ()
enable_msvcrt_Math_Precision="$1"
enable_msvcrt_StdHandle_RefCount="$1"
enable_msvfw32_Image_Size="$1"
enable_notepad_New_File="$1"
enable_ntdll_APC_Performance="$1"
enable_ntdll_APC_Start_Process="$1"
enable_ntdll_Activation_Context="$1"
@@ -567,6 +568,9 @@ patch_enable ()
msvfw32-Image_Size)
enable_msvfw32_Image_Size="$2"
;;
notepad-New_File)
enable_notepad_New_File="$2"
;;
ntdll-APC_Performance)
enable_ntdll_APC_Performance="$2"
;;
@@ -3582,6 +3586,21 @@ if test "$enable_msvfw32_Image_Size" -eq 1; then
) >> "$patchlist"
fi
# Patchset notepad-New_File
# |
# | This patchset fixes the following Wine bugs:
# | * [#19425] Notepad should create new files immediately
# |
# | Modified files:
# | * programs/notepad/main.c
# |
if test "$enable_notepad_New_File" -eq 1; then
patch_apply notepad-New_File/0001-notepad-Make-sure-new-files-are-created-immediately.patch
(
echo '+ { "Sebastian Lackner", "notepad: Make sure new files are created immediately.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-APC_Performance
# |
# | Modified files: