winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
999 discussions
Start a n
N
ew thread
Frans Kool : winefile: Added Dutch translations.
by Alexandre Julliard
13 Feb '08
13 Feb '08
Module: wine Branch: master Commit: 9d2320c933880006641dfadd221f48ddc1589d30 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d2320c933880006641dfadd2…
Author: Frans Kool <Frans.Kool(a)gmail.com> Date: Tue Feb 12 22:22:22 2008 +0100 winefile: Added Dutch translations. --- programs/winefile/Nl.rc | 125 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 125 insertions(+), 0 deletions(-) diff --git a/programs/winefile/Nl.rc b/programs/winefile/Nl.rc index 8b85139..50ee5fe 100644 --- a/programs/winefile/Nl.rc +++ b/programs/winefile/Nl.rc @@ -158,3 +158,128 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON "Annuleren", 2, 158, 23, 47, 14 PUSHBUTTON "&Help", 254, 158, 43, 47, 14 } + +IDD_SELECT_DESTINATION DIALOG FIXED IMPURE 15, 13, 210, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Selecteer bestemming" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", 101, "Static", SS_SIMPLE|SS_NOPREFIX, 3, 6, 162, 10 + CONTROL "&Locatie:", -1, "Static", SS_LEFTNOWORDWRAP|WS_GROUP, 3, 18, 60, 10 + EDITTEXT 201, 3, 29, 134, 12, ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", 1, 158, 6, 47, 14 + PUSHBUTTON "Annuleren", 2, 158, 23, 47, 14 + PUSHBUTTON "&Bladeren", 254, 158, 43, 47, 14 +} + +IDD_DIALOG_VIEW_TYPE DIALOG DISCARDABLE 15, 13, 161, 97 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Per Bestandstype" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Naam:",-1,7,8,22,10 + EDITTEXT IDC_VIEW_PATTERN,31,7,63,12,ES_AUTOHSCROLL + GROUPBOX "Bestandstype",-1,7,23,87,56 + CONTROL "&Directories",IDC_VIEW_TYPE_DIRECTORIES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,32,70,10 + CONTROL "&Programma's",IDC_VIEW_TYPE_PROGRAMS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,43,70,10 + CONTROL "Docu&menten",IDC_VIEW_TYPE_DOCUMENTS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,54,70,10 + CONTROL "&Overige bestanden",IDC_VIEW_TYPE_OTHERS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,65,70,10 + CONTROL "Toon Verborgen/&Systeem Bestanden",IDC_VIEW_TYPE_HIDDEN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,81,106,9 + DEFPUSHBUTTON "OK",IDOK,104,7,50,14 + PUSHBUTTON "Annuleren",IDCANCEL,104,24,50,14 +END + +IDD_DIALOG_PROPERTIES DIALOG DISCARDABLE 0, 0, 248, 215 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Eigenschappen voor %s" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,191,7,50,14 + PUSHBUTTON "Annuleren",IDCANCEL,191,29,50,14 + LTEXT "&Bestandsnaam:",-1,7,7,59,9 + EDITTEXT IDC_STATIC_PROP_FILENAME,71,7,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "Volledig &Pad:",-1,7,18,59,9 + EDITTEXT IDC_STATIC_PROP_PATH,71,18,120,9, ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "Laatste Wijziging:",-1,7,29,59,9 + EDITTEXT IDC_STATIC_PROP_LASTCHANGE,71,29,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "Versie:",-1,7,40,59,9 + EDITTEXT IDC_STATIC_PROP_VERSION,71,40,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "Cop&yright:",-1,7,51,59,9 + EDITTEXT IDC_STATIC_PROP_COPYRIGHT,71,51,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + LTEXT "Grootte:",-1,7,62,59,9 + EDITTEXT IDC_STATIC_PROP_SIZE,71,62,120,9,ES_READONLY | NOT WS_BORDER | WS_TABSTOP + GROUPBOX "Attributen",-1,7,79,158,46 + CONTROL "A&lleen Lezen",IDC_CHECK_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,91,68,9 + CONTROL "V&erborgen",IDC_CHECK_HIDDEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,91,68,9 + CONTROL "&Archiveren",IDC_CHECK_ARCHIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,101,68,9 + CONTROL "&Systeem",IDC_CHECK_SYSTEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,101,68,9 + CONTROL "Ge&comprimeerd",IDC_CHECK_COMPRESSED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,17,111,68,9 + GROUPBOX "&Versie Informatie",-1,7,129,234,79 + LISTBOX IDC_LIST_PROP_VERSION_TYPES,13,139,107,63,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_LIST_PROP_VERSION_VALUES,123,139,111,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL +END + + +STRINGTABLE +{ + IDS_FONT_SEL_DLG_NAME "Lettertype wordt toegepast" + IDS_FONT_SEL_ERROR "Probleem tijdens het selecteren van het nieuwe lettertype." +} + +STRINGTABLE +{ + IDS_WINEFILE "Winefile" + IDS_ERROR "Fout" + IDS_ROOT_FS "root fs" + IDS_UNIXFS "unixfs" + IDS_DESKTOP "Bureaublad" + IDS_SHELL "Shell" + IDS_TITLEFMT "%s - %s" + IDS_NO_IMPL "Nog niet geimplementeerd" + IDS_WINE "WINE" + IDS_WINE_FILE "Wine File" +} + +STRINGTABLE +{ + IDS_COL_NAME "Naam" + IDS_COL_SIZE "Grootte" + IDS_COL_CDATE "CDatum" + IDS_COL_ADATE "ADatum" + IDS_COL_MDATE "MDatum" + IDS_COL_IDX "Index/Inode" + IDS_COL_LINKS "Links" + IDS_COL_ATTR "Attributen" + IDS_COL_SEC "Beveiliging" + + IDS_FREE_SPACE_FMT "%s van %s vrij" +} + +STRINGTABLE +{ +IDS_LICENSE_CAPTION, "LICENTIE" +IDS_LICENSE, +"This library is free software; you can redistribute it and/or \ +modify it under the terms of the GNU Lesser General Public \ +License as published by the Free Software Foundation; either \ +version 2.1 of the License, or (at your option) any later version.\n\ +This library is distributed in the hope that it will be useful, \ +but WITHOUT ANY WARRANTY; without even the implied warranty of \ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \ +Lesser General Public License for more details.\n\ +You should have received a copy of the GNU Lesser General Public \ +License along with this library; if not, write to the Free Software \ +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA" + +IDS_WARRANTY_CAPTION, "NO WARRANTY" +IDS_WARRANTY, +"This library is distributed in the hope that it will be useful, \ +but WITHOUT ANY WARRANTY; without even the implied warranty of \ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \ +Lesser General Public License for more details." +}
1
0
0
0
Dmitry Timoshkov : user32: Add a couple of tests for WS_EX_TOPMOST.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 066c60eb312609737b4b66e69c91750612364b05 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=066c60eb312609737b4b66e69…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Feb 7 23:03:39 2008 +0800 user32: Add a couple of tests for WS_EX_TOPMOST. --- dlls/user32/tests/win.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index d0a9673..7e4c98c 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1857,6 +1857,14 @@ static void test_SetWindowPos(HWND hwnd) SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top, orig_win_rc.right, orig_win_rc.bottom, 0); + + ok(!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); + SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); + SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); } static void test_SetMenu(HWND parent)
1
0
0
0
Erich Hoover : kernel32: Add tests for ReplaceFileA and ReplaceFileW.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 664c68a2c95eb28bb26f56294402a1e281ab1b96 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=664c68a2c95eb28bb26f56294…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Tue Feb 12 23:03:37 2008 +0100 kernel32: Add tests for ReplaceFileA and ReplaceFileW. --- dlls/kernel32/tests/file.c | 252 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 252 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=664c68a2c95eb28bb26f5…
1
0
0
0
Rob Shearman : kernel32: Implement ReplaceFileW.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: c72de7bce2c4c5bda08caa61f140fb4a5358997f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c72de7bce2c4c5bda08caa61f…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Thu Feb 7 12:43:25 2008 +0000 kernel32: Implement ReplaceFileW. Based on a patch by Erich Hoover. --- dlls/kernel32/file.c | 163 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 158 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index acc762b..a5da6c6 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1524,14 +1524,167 @@ BOOL WINAPI DeleteFileA( LPCSTR path ) * ReplaceFileW (KERNEL32.@) * ReplaceFile (KERNEL32.@) */ -BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName,LPCWSTR lpReplacementFileName, +BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileName, LPCWSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved) { - FIXME("(%s,%s,%s,%08x,%p,%p) stub\n",debugstr_w(lpReplacedFileName),debugstr_w(lpReplacementFileName), - debugstr_w(lpBackupFileName),dwReplaceFlags,lpExclude,lpReserved); - SetLastError(ERROR_UNABLE_TO_MOVE_REPLACEMENT); - return FALSE; + UNICODE_STRING nt_replaced_name, nt_replacement_name; + ANSI_STRING unix_replaced_name, unix_replacement_name, unix_backup_name; + HANDLE hReplaced = NULL, hReplacement = NULL, hBackup = NULL; + DWORD error = ERROR_SUCCESS; + UINT replaced_flags; + BOOL ret = FALSE; + NTSTATUS status; + IO_STATUS_BLOCK io; + OBJECT_ATTRIBUTES attr; + + if (dwReplaceFlags) + FIXME("Ignoring flags %x\n", dwReplaceFlags); + + /* First two arguments are mandatory */ + if (!lpReplacedFileName || !lpReplacementFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + unix_replaced_name.Buffer = NULL; + unix_replacement_name.Buffer = NULL; + unix_backup_name.Buffer = NULL; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = NULL; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + /* Open the "replaced" file for reading and writing */ + if (!(RtlDosPathNameToNtPathName_U(lpReplacedFileName, &nt_replaced_name, NULL, NULL))) + { + error = ERROR_PATH_NOT_FOUND; + goto fail; + } + replaced_flags = lpBackupFileName ? FILE_OPEN : FILE_OPEN_IF; + attr.ObjectName = &nt_replaced_name; + status = NtOpenFile(&hReplaced, GENERIC_READ|GENERIC_WRITE|DELETE|SYNCHRONIZE, + &attr, &io, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE); + if (status == STATUS_SUCCESS) + status = wine_nt_to_unix_file_name(&nt_replaced_name, &unix_replaced_name, replaced_flags, FALSE); + RtlFreeUnicodeString(&nt_replaced_name); + if (status != STATUS_SUCCESS) + { + if (status == STATUS_OBJECT_NAME_NOT_FOUND) + error = ERROR_FILE_NOT_FOUND; + else + error = ERROR_UNABLE_TO_REMOVE_REPLACED; + goto fail; + } + + /* + * Open the replacement file for reading, writing, and deleting + * (writing and deleting are needed when finished) + */ + if (!(RtlDosPathNameToNtPathName_U(lpReplacementFileName, &nt_replacement_name, NULL, NULL))) + { + error = ERROR_PATH_NOT_FOUND; + goto fail; + } + attr.ObjectName = &nt_replacement_name; + status = NtOpenFile(&hReplacement, + GENERIC_READ|GENERIC_WRITE|DELETE|WRITE_DAC|SYNCHRONIZE, + &attr, &io, 0, + FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE); + if (status == STATUS_SUCCESS) + status = wine_nt_to_unix_file_name(&nt_replacement_name, &unix_replacement_name, FILE_OPEN, FALSE); + RtlFreeUnicodeString(&nt_replacement_name); + if (status != STATUS_SUCCESS) + { + error = RtlNtStatusToDosError(status); + goto fail; + } + + /* If the user wants a backup then that needs to be performed first */ + if (lpBackupFileName) + { + UNICODE_STRING nt_backup_name; + FILE_BASIC_INFORMATION replaced_info; + + /* Obtain the file attributes from the "replaced" file */ + status = NtQueryInformationFile(hReplaced, &io, &replaced_info, + sizeof(replaced_info), + FileBasicInformation); + if (status != STATUS_SUCCESS) + { + error = RtlNtStatusToDosError(status); + goto fail; + } + + if (!(RtlDosPathNameToNtPathName_U(lpBackupFileName, &nt_backup_name, NULL, NULL))) + { + error = ERROR_PATH_NOT_FOUND; + goto fail; + } + attr.ObjectName = &nt_backup_name; + /* Open the backup with permissions to write over it */ + status = NtCreateFile(&hBackup, GENERIC_WRITE, + &attr, &io, NULL, replaced_info.FileAttributes, + FILE_SHARE_WRITE, FILE_OPEN_IF, + FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE, + NULL, 0); + if (status == STATUS_SUCCESS) + status = wine_nt_to_unix_file_name(&nt_backup_name, &unix_backup_name, FILE_OPEN_IF, FALSE); + if (status != STATUS_SUCCESS) + { + error = RtlNtStatusToDosError(status); + goto fail; + } + + /* If an existing backup exists then copy over it */ + if (rename(unix_replaced_name.Buffer, unix_backup_name.Buffer) == -1) + { + error = ERROR_UNABLE_TO_REMOVE_REPLACED; /* is this correct? */ + goto fail; + } + } + + /* + * Now that the backup has been performed (if requested), copy the replacement + * into place + */ + if (rename(unix_replacement_name.Buffer, unix_replaced_name.Buffer) == -1) + { + if (errno == EACCES) + { + /* Inappropriate permissions on "replaced", rename will fail */ + error = ERROR_UNABLE_TO_REMOVE_REPLACED; + goto fail; + } + /* on failure we need to indicate whether a backup was made */ + if (!lpBackupFileName) + error = ERROR_UNABLE_TO_MOVE_REPLACEMENT; + else + error = ERROR_UNABLE_TO_MOVE_REPLACEMENT_2; + goto fail; + } + /* Success! */ + ret = TRUE; + + /* Perform resource cleanup */ +fail: + if (hBackup) CloseHandle(hBackup); + if (hReplaced) CloseHandle(hReplaced); + if (hReplacement) CloseHandle(hReplacement); + RtlFreeAnsiString(&unix_backup_name); + RtlFreeAnsiString(&unix_replacement_name); + RtlFreeAnsiString(&unix_replaced_name); + + /* If there was an error, set the error code */ + if(!ret) + SetLastError(error); + return ret; }
1
0
0
0
Erich Hoover : kernel32: Implement ReplaceFileA.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 06a3c3a281f4af6f6d37caf97a9234e183a5338f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06a3c3a281f4af6f6d37caf97…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Tue Feb 12 23:02:34 2008 +0100 kernel32: Implement ReplaceFileA. --- dlls/kernel32/file.c | 35 +++++++++++++++++++++++++++++++---- 1 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 4e05c28..acc762b 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1542,10 +1542,37 @@ BOOL WINAPI ReplaceFileA(LPCSTR lpReplacedFileName,LPCSTR lpReplacementFileName, LPCSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved) { - FIXME("(%s,%s,%s,%08x,%p,%p) stub\n",lpReplacedFileName,lpReplacementFileName, - lpBackupFileName,dwReplaceFlags,lpExclude,lpReserved); - SetLastError(ERROR_UNABLE_TO_MOVE_REPLACEMENT); - return FALSE; + WCHAR *replacedW, *replacementW, *backupW = NULL; + BOOL ret; + + /* This function only makes sense when the first two parameters are defined */ + if (!lpReplacedFileName || !(replacedW = FILE_name_AtoW( lpReplacedFileName, TRUE ))) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if (!lpReplacementFileName || !(replacementW = FILE_name_AtoW( lpReplacementFileName, TRUE ))) + { + HeapFree( GetProcessHeap(), 0, replacedW ); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + /* The backup parameter, however, is optional */ + if (lpBackupFileName) + { + if (!(backupW = FILE_name_AtoW( lpBackupFileName, TRUE ))) + { + HeapFree( GetProcessHeap(), 0, replacedW ); + HeapFree( GetProcessHeap(), 0, replacementW ); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + } + ret = ReplaceFileW( replacedW, replacementW, backupW, dwReplaceFlags, lpExclude, lpReserved ); + HeapFree( GetProcessHeap(), 0, replacedW ); + HeapFree( GetProcessHeap(), 0, replacementW ); + HeapFree( GetProcessHeap(), 0, backupW ); + return ret; }
1
0
0
0
Andrew Talbot : comctl32: Assign to structs instead of using memcpy.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 8d555e825b3b3e52269c673fadcef77f71b5883c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d555e825b3b3e52269c673fa…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Tue Feb 12 21:13:06 2008 +0000 comctl32: Assign to structs instead of using memcpy. --- dlls/comctl32/comboex.c | 2 +- dlls/comctl32/rebar.c | 4 ++-- dlls/comctl32/toolbar.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 379d964..a98243d 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -243,7 +243,7 @@ static INT COMBOEX_NotifyEndEdit (COMBOEX_INFO *infoPtr, NMCBEENDEDITW *neew, LP } else { NMCBEENDEDITA neea; - memcpy (&neea.hdr, &neew->hdr, sizeof(NMHDR)); + neea.hdr = neew->hdr; neea.fChanged = neew->fChanged; neea.iNewSelection = neew->iNewSelection; WideCharToMultiByte (CP_ACP, 0, wstr, -1, neea.szText, CBEMAXSTRLEN, 0, 0); diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index fa3033a..92c1922 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -2423,7 +2423,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } /* save one to be moved */ - memcpy (&holder, &oldBands[uFrom], sizeof(REBAR_BAND)); + holder = oldBands[uFrom]; /* close up rest of bands (pseudo delete) */ if (uFrom < infoPtr->uNumBands - 1) { @@ -2442,7 +2442,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } /* set moved band */ - memcpy (&infoPtr->bands[uTo], &holder, sizeof(REBAR_BAND)); + infoPtr->bands[uTo] = holder; /* post copy */ if (uTo < infoPtr->uNumBands - 1) { diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 6d88461..b14b7a7 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -2087,7 +2087,7 @@ static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT /* duplicate 'separator' button */ btnNew = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); - memcpy(btnNew, btnInfo, sizeof(CUSTOMBUTTON)); + *btnNew = *btnInfo; btnInfo = btnNew; } @@ -2370,7 +2370,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) IDC_TOOLBARBTN_LBOX, LB_GETITEMDATA, index, 0); } - memcpy (&btnInfo->btn, &nmtb.tbButton, sizeof(TBBUTTON)); + btnInfo->btn = nmtb.tbButton; if (!(nmtb.tbButton.fsStyle & BTNS_SEP)) { if (lstrlenW(nmtb.pszText)) @@ -6455,7 +6455,7 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam) PAINTSTRUCT ps; /* fill ps.rcPaint with a default rect */ - memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound)); + ps.rcPaint = infoPtr->rcBound; hdc = wParam==0 ? BeginPaint(hwnd, &ps) : (HDC)wParam; @@ -7179,7 +7179,7 @@ static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb) MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1, nmtb->pszText, nmtb->cchText); - memcpy(&nmtb->tbButton, &nmtba.tbButton, sizeof(TBBUTTON)); + nmtb->tbButton = nmtba.tbButton; bRet = TRUE; }
1
0
0
0
James Hawkins : msi: Handle carriage returns in MsiDatabaseImport.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: ec086f77e3261dacb501b0f03265cd68cbaaa44e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ec086f77e3261dacb501b0f03…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Feb 12 01:37:56 2008 -0600 msi: Handle carriage returns in MsiDatabaseImport. --- dlls/msi/database.c | 22 +++++++-- dlls/msi/tests/automation.c | 1 + dlls/msi/tests/db.c | 98 ++++++++++++++++--------------------------- 3 files changed, 54 insertions(+), 67 deletions(-) diff --git a/dlls/msi/database.c b/dlls/msi/database.c index a7dc285..425486e 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -317,12 +317,18 @@ static void msi_parse_line(LPWSTR *line, LPWSTR **entries, DWORD *num_entries) /* store pointers into the data */ for (i = 0, ptr = *line; i < count; i++) { + while (*ptr && *ptr == '\r') ptr++; save = ptr; - while (*ptr && *ptr != '\t' && *ptr != '\n') ptr++; + while (*ptr && *ptr != '\t' && *ptr != '\n' && *ptr != '\r') ptr++; /* NULL-separate the data */ - if (*ptr) + if (*ptr == '\n' || *ptr == '\r') + { + while (*ptr == '\n' || *ptr == '\r') + *(ptr++) = '\0'; + } + else if (*ptr) *ptr++ = '\0'; (*entries)[i] = save; @@ -598,11 +604,11 @@ UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) { UINT r; DWORD len, i; - DWORD num_labels; + DWORD num_labels, num_types; DWORD num_columns, num_records = 0; LPWSTR *columns, *types, *labels; LPWSTR path, ptr, data; - LPWSTR **records; + LPWSTR **records = NULL; LPWSTR **temp_records; static const WCHAR backslash[] = {'\\',0}; @@ -625,9 +631,15 @@ UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) ptr = data; msi_parse_line( &ptr, &columns, &num_columns ); - msi_parse_line( &ptr, &types, NULL ); + msi_parse_line( &ptr, &types, &num_types ); msi_parse_line( &ptr, &labels, &num_labels ); + if (num_columns != num_types) + { + r = ERROR_FUNCTION_FAILED; + goto done; + } + records = msi_alloc(sizeof(LPWSTR *)); if (!records) { diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 3ae4a7b..8cf764e 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -272,6 +272,7 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t write_file(table->filename, table->data, (table->size - 1) * sizeof(char)); + printf("table->filename: %s\n", table->filename); r = MsiDatabaseImportA(db, CURR_DIR, table->filename); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 684379e..fa3b55b 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -1643,10 +1643,7 @@ static void test_msiimport(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = add_table_to_db(hdb, endlines1); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = add_table_to_db(hdb, endlines2); ok(r == ERROR_FUNCTION_FAILED, @@ -1749,7 +1746,8 @@ static void test_msiimport(void) MsiCloseHandle(rec); r = MsiViewFetch(view, &rec); - ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); + ok(r == ERROR_NO_MORE_ITEMS, + "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); r = MsiViewClose(view); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -1758,37 +1756,28 @@ static void test_msiimport(void) query = "SELECT * FROM `Table`"; r = MsiDatabaseOpenView(hdb, query, &view); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); count = MsiRecordGetFieldCount(rec); - todo_wine - { - ok(count == 6, "Expected 6, got %d\n", count); - ok(check_record(rec, 1, "A"), "Expected A\n"); - ok(check_record(rec, 2, "B"), "Expected B\n"); - ok(check_record(rec, 3, "C"), "Expected C\n"); - ok(check_record(rec, 4, "D"), "Expected D\n"); - ok(check_record(rec, 5, "E"), "Expected E\n"); - ok(check_record(rec, 6, "F"), "Expected F\n"); - } + ok(count == 6, "Expected 6, got %d\n", count); + ok(check_record(rec, 1, "A"), "Expected A\n"); + ok(check_record(rec, 2, "B"), "Expected B\n"); + ok(check_record(rec, 3, "C"), "Expected C\n"); + ok(check_record(rec, 4, "D"), "Expected D\n"); + ok(check_record(rec, 5, "E"), "Expected E\n"); + ok(check_record(rec, 6, "F"), "Expected F\n"); MsiCloseHandle(rec); r = MsiViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec); count = MsiRecordGetFieldCount(rec); - todo_wine - { - ok(count == 6, "Expected 6, got %d\n", count); - ok(check_record(rec, 1, "s72"), "Expected s72\n"); - ok(check_record(rec, 2, "s72"), "Expected s72\n"); - ok(check_record(rec, 3, "s72"), "Expected s72\n"); - ok(check_record(rec, 4, "s72"), "Expected s72\n"); - ok(check_record(rec, 5, "s72"), "Expected s72\n"); - ok(check_record(rec, 6, "s72"), "Expected s72\n"); - } + ok(count == 6, "Expected 6, got %d\n", count); + ok(check_record(rec, 1, "s72"), "Expected s72\n"); + ok(check_record(rec, 2, "s72"), "Expected s72\n"); + ok(check_record(rec, 3, "s72"), "Expected s72\n"); + ok(check_record(rec, 4, "s72"), "Expected s72\n"); + ok(check_record(rec, 5, "s72"), "Expected s72\n"); + ok(check_record(rec, 6, "s72"), "Expected s72\n"); MsiCloseHandle(rec); MsiViewClose(view); @@ -1796,51 +1785,36 @@ static void test_msiimport(void) query = "SELECT * FROM `Table`"; r = MsiDatabaseOpenView(hdb, query, &view); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewExecute(view, 0); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = MsiViewFetch(view, &rec); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(check_record(rec, 1, "a"), "Expected 'a'\n"); - ok(check_record(rec, 2, "b"), "Expected 'b'\n"); - ok(check_record(rec, 3, "c"), "Expected 'c'\n"); - ok(check_record(rec, 4, "d"), "Expected 'd'\n"); - ok(check_record(rec, 5, "e"), "Expected 'e'\n"); - ok(check_record(rec, 6, "f"), "Expected 'f'\n"); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(check_record(rec, 1, "a"), "Expected 'a'\n"); + ok(check_record(rec, 2, "b"), "Expected 'b'\n"); + ok(check_record(rec, 3, "c"), "Expected 'c'\n"); + ok(check_record(rec, 4, "d"), "Expected 'd'\n"); + ok(check_record(rec, 5, "e"), "Expected 'e'\n"); + ok(check_record(rec, 6, "f"), "Expected 'f'\n"); MsiCloseHandle(rec); r = MsiViewFetch(view, &rec); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(check_record(rec, 1, "g"), "Expected 'g'\n"); - ok(check_record(rec, 2, "h"), "Expected 'h'\n"); - ok(check_record(rec, 3, "i"), "Expected 'i'\n"); - ok(check_record(rec, 4, "j"), "Expected 'j'\n"); - ok(check_record(rec, 5, "k"), "Expected 'k'\n"); - ok(check_record(rec, 6, "l"), "Expected 'l'\n"); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(check_record(rec, 1, "g"), "Expected 'g'\n"); + ok(check_record(rec, 2, "h"), "Expected 'h'\n"); + ok(check_record(rec, 3, "i"), "Expected 'i'\n"); + ok(check_record(rec, 4, "j"), "Expected 'j'\n"); + ok(check_record(rec, 5, "k"), "Expected 'k'\n"); + ok(check_record(rec, 6, "l"), "Expected 'l'\n"); MsiCloseHandle(rec); r = MsiViewFetch(view, &rec); - todo_wine - { - ok(r == ERROR_NO_MORE_ITEMS, - "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); - } + ok(r == ERROR_NO_MORE_ITEMS, + "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); MsiViewClose(view); MsiCloseHandle(view);
1
0
0
0
James Hawkins : msi: Use MsiViewModify instead of building a SQL query when adding rows to the table .
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 00cfd2899b7b8bf41c437170883ab0435b583eff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00cfd2899b7b8bf41c4371708…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Feb 12 01:37:14 2008 -0600 msi: Use MsiViewModify instead of building a SQL query when adding rows to the table. --- dlls/msi/database.c | 176 +++++++++++++++++---------------------------------- dlls/msi/tests/db.c | 24 ++----- 2 files changed, 63 insertions(+), 137 deletions(-) diff --git a/dlls/msi/database.c b/dlls/msi/database.c index 65db00b..a7dc285 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -509,156 +509,88 @@ static UINT msi_add_table_to_db(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, return r; } -static LPWSTR msi_build_insertsql_prelude(LPWSTR table) +static UINT construct_record(DWORD num_columns, LPWSTR *types, + LPWSTR *data, MSIRECORD **rec) { - LPWSTR prelude; - DWORD size; - - static const WCHAR insert_fmt[] = {'I','N','S','E','R','T',' ','I','N','T','O',' ','`','%','s','`',' ','(',' ',0}; - - size = sizeof(insert_fmt) + lstrlenW(table) - 2; - prelude = msi_alloc(size * sizeof(WCHAR)); - if (!prelude) - return NULL; - - sprintfW(prelude, insert_fmt, table); - return prelude; -} + UINT i; -static LPWSTR msi_build_insertsql_columns(LPWSTR *columns_data, LPWSTR *types, DWORD num_columns) -{ - LPWSTR columns, p; - DWORD sql_size = 1, i; - WCHAR expanded[128]; - - static const WCHAR column_fmt[] = {'`','%','s','`',',',' ',0}; - - columns = msi_alloc_zero(sql_size * sizeof(WCHAR)); - if (!columns) - return NULL; - - for (i = 0; i < num_columns; i++) - { - sprintfW(expanded, column_fmt, columns_data[i]); - sql_size += lstrlenW(expanded); - - if (i == num_columns - 1) - { - sql_size -= 2; - expanded[lstrlenW(expanded) - 2] = '\0'; - } - - p = msi_realloc(columns, sql_size * sizeof(WCHAR)); - if (!p) - { - msi_free(columns); - return NULL; - } - columns = p; - - lstrcatW(columns, expanded); - } - - return columns; -} - -static LPWSTR msi_build_insertsql_data(LPWSTR **records, LPWSTR *types, DWORD num_columns, DWORD irec) -{ - LPWSTR columns, temp_columns; - DWORD sql_size = 1, i; - WCHAR expanded[128]; - - static const WCHAR str_fmt[] = {'\'','%','s','\'',',',' ',0}; - static const WCHAR int_fmt[] = {'%','s',',',' ',0}; - static const WCHAR empty[] = {'\'','\'',',',' ',0}; - - columns = msi_alloc_zero(sql_size * sizeof(WCHAR)); - if (!columns) - return NULL; + *rec = MSI_CreateRecord(num_columns); + if (!*rec) + return ERROR_OUTOFMEMORY; for (i = 0; i < num_columns; i++) { switch (types[i][0]) { case 'L': case 'l': case 'S': case 's': - sprintfW(expanded, str_fmt, records[irec][i]); + MSI_RecordSetStringW(*rec, i + 1, data[i]); break; case 'I': case 'i': - if (*records[0][i]) - sprintfW(expanded, int_fmt, records[irec][i]); - else - lstrcpyW(expanded, empty); + if (*data[i]) + MSI_RecordSetInteger(*rec, i + 1, atoiW(data[i])); break; default: - HeapFree( GetProcessHeap(), 0, columns ); - return NULL; - } - - if (i == num_columns - 1) - expanded[lstrlenW(expanded) - 2] = '\0'; - - sql_size += lstrlenW(expanded); - temp_columns = msi_realloc(columns, sql_size * sizeof(WCHAR)); - if (!temp_columns) - { - HeapFree( GetProcessHeap(), 0, columns); - return NULL; + ERR("Unhandled column type: %c\n", types[i][0]); + msiobj_release(&(*rec)->hdr); + return ERROR_FUNCTION_FAILED; } - columns = temp_columns; - - lstrcatW(columns, expanded); } - return columns; + return ERROR_SUCCESS; } static UINT msi_add_records_to_table(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, LPWSTR *labels, LPWSTR **records, int num_columns, int num_records) { + UINT r; + DWORD i, size; MSIQUERY *view; - LPWSTR insert_sql; - DWORD size, i; - UINT r = ERROR_SUCCESS; + MSIRECORD *rec; + LPWSTR query; - static const WCHAR mid[] = {' ',')',' ','V','A','L','U','E','S',' ','(',' ',0}; - static const WCHAR end[] = {' ',')',0}; + static const WCHAR select[] = { + 'S','E','L','E','C','T',' ','*',' ', + 'F','R','O','M',' ','`','%','s','`',0 + }; - LPWSTR prelude = msi_build_insertsql_prelude(labels[0]); - LPWSTR columns_sql = msi_build_insertsql_columns(columns, types, num_columns); - - for (i = 0; i < num_records; i++) - { - LPWSTR data = msi_build_insertsql_data(records, types, num_columns, i); + size = lstrlenW(select) + lstrlenW(labels[0]) - 1; + query = msi_alloc(size * sizeof(WCHAR)); + if (!query) + return ERROR_OUTOFMEMORY; - size = lstrlenW(prelude) + lstrlenW(columns_sql) + sizeof(mid) + lstrlenW(data) + sizeof(end) - 1; - insert_sql = msi_alloc(size * sizeof(WCHAR)); - if (!insert_sql) - return ERROR_OUTOFMEMORY; - - lstrcpyW(insert_sql, prelude); - lstrcatW(insert_sql, columns_sql); - lstrcatW(insert_sql, mid); - lstrcatW(insert_sql, data); - lstrcatW(insert_sql, end); + sprintfW(query, select, labels[0]); - msi_free(data); + r = MSI_DatabaseOpenViewW(db, query, &view); + msi_free(query); + if (r != ERROR_SUCCESS) + return r; - r = MSI_DatabaseOpenViewW( db, insert_sql, &view ); - msi_free(insert_sql); + while (MSI_ViewFetch(view, &rec) != ERROR_NO_MORE_ITEMS) + { + r = MSI_ViewModify(view, MSIMODIFY_DELETE, rec); + if (r != ERROR_SUCCESS) + goto done; + } + for (i = 0; i < num_records; i++) + { + r = construct_record(num_columns, types, records[i], &rec); if (r != ERROR_SUCCESS) goto done; - r = MSI_ViewExecute(view, NULL); - MSI_ViewClose(view); - msiobj_release(&view->hdr); + r = MSI_ViewModify(view, MSIMODIFY_INSERT, rec); + if (r != ERROR_SUCCESS) + { + msiobj_release(&rec->hdr); + goto done; + } + + msiobj_release(&rec->hdr); } done: - msi_free(prelude); - msi_free(columns_sql); - + msiobj_release(&view->hdr); return r; } @@ -718,9 +650,15 @@ UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file) records = temp_records; } - r = msi_add_table_to_db( db, columns, types, labels, num_labels, num_columns ); - if (r != ERROR_SUCCESS) - goto done; + if (!TABLE_Exists(db, labels[0])) + { + r = msi_add_table_to_db( db, columns, types, labels, num_labels, num_columns ); + if (r != ERROR_SUCCESS) + { + r = ERROR_FUNCTION_FAILED; + goto done; + } + } r = msi_add_records_to_table( db, columns, types, labels, records, num_columns, num_records ); diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 468f486..684379e 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -1649,11 +1649,8 @@ static void test_msiimport(void) } r = add_table_to_db(hdb, endlines2); - todo_wine - { - ok(r == ERROR_FUNCTION_FAILED, - "Expected ERROR_FUNCTION_FAILED, got %d\n", r); - } + ok(r == ERROR_FUNCTION_FAILED, + "Expected ERROR_FUNCTION_FAILED, got %d\n", r); query = "SELECT * FROM `TestTable`"; r = MsiDatabaseOpenView(hdb, query, &view); @@ -5255,10 +5252,7 @@ static void test_quotes(void) write_file("import.idt", import_dat, (sizeof(import_dat) - 1) * sizeof(char)); r = MsiDatabaseImportA(hdb, CURR_DIR, "import.idt"); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); DeleteFileA("import.idt"); @@ -5275,19 +5269,13 @@ static void test_quotes(void) size = MAX_PATH; r = MsiRecordGetString(hrec, 1, buf, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmp(buf, "This is a new 'string' ok"), - "Expected \"This is a new 'string' ok\", got %s\n", buf); - } + ok(!lstrcmp(buf, "This is a new 'string' ok"), + "Expected \"This is a new 'string' ok\", got %s\n", buf); MsiCloseHandle(hrec); r = MsiViewFetch(hview, &hrec); - todo_wine - { - ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); - } + ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); MsiCloseHandle(hview);
1
0
0
0
James Hawkins : msi: Read the language info from the file.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 4cc569cce6cdbf7c2053e1eee979b9e8e6619b42 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4cc569cce6cdbf7c2053e1eee…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Feb 12 01:36:34 2008 -0600 msi: Read the language info from the file. --- dlls/msi/msi.c | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index bee273d..7840a4c 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1622,11 +1622,15 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, static const WCHAR szVersionResource[] = {'\\',0}; static const WCHAR szVersionFormat[] = { '%','d','.','%','d','.','%','d','.','%','d',0}; + static const WCHAR szLangResource[] = { + '\\','V','a','r','F','i','l','e','I','n','f','o','\\', + 'T','r','a','n','s','l','a','t','i','o','n',0}; static const WCHAR szLangFormat[] = {'%','d',0}; UINT ret = 0; DWORD dwVerLen, gle; LPVOID lpVer = NULL; VS_FIXEDFILEINFO *ffi; + USHORT *lang; UINT puLen; WCHAR tmp[32]; @@ -1687,16 +1691,22 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, if (pcchLangBuf) { - DWORD lang = GetUserDefaultLangID(); - - FIXME("Retrieve language from file\n"); - wsprintfW(tmp, szLangFormat, lang); - if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf); + if (VerQueryValueW(lpVer, szLangResource, (LPVOID*)&lang, &puLen) && + (puLen > 0)) + { + wsprintfW(tmp, szLangFormat, *lang); + if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf); - if (lstrlenW(tmp) >= *pcchLangBuf) - ret = ERROR_MORE_DATA; + if (lstrlenW(tmp) >= *pcchLangBuf) + ret = ERROR_MORE_DATA; - *pcchLangBuf = lstrlenW(tmp); + *pcchLangBuf = lstrlenW(tmp); + } + else + { + if (lpLangBuf) *lpLangBuf = 0; + *pcchLangBuf = 0; + } } end:
1
0
0
0
James Hawkins : msi: Reimplement MsiGetProductInfo.
by Alexandre Julliard
12 Feb '08
12 Feb '08
Module: wine Branch: master Commit: 1f3d6a974412d756ddbde0d241db199bc70a165b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f3d6a974412d756ddbde0d24…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Feb 12 01:35:46 2008 -0600 msi: Reimplement MsiGetProductInfo. --- dlls/msi/msi.c | 193 ++++++++++++------- dlls/msi/msipriv.h | 1 + dlls/msi/registry.c | 2 - dlls/msi/tests/automation.c | 9 +- dlls/msi/tests/msi.c | 454 ++++++++++++++----------------------------- 5 files changed, 274 insertions(+), 385 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=1f3d6a974412d756ddbde…
1
0
0
0
← Newer
1
...
66
67
68
69
70
71
72
...
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200