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
May 2019
----- 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
2 participants
1019 discussions
Start a n
N
ew thread
Zebediah Figura : setupapi: Remove implementation for LayoutInf parameter of SP_FILE_COPY_PARAMS.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: ee36f923c59d9ba51b429247df90e0ed30592e62 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee36f923c59d9ba51b429247…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed May 1 18:24:06 2019 -0500 setupapi: Remove implementation for LayoutInf parameter of SP_FILE_COPY_PARAMS. Tests demonstrate that the existing implementation is not correct, and I was unable to find an arrangement of parameters such that it was respected on Windows. Most likely it has to do with the undocumented parameters used in the "master" C:\windows\inf\layout.inf. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/parser.c | 20 ---------- dlls/setupapi/queue.c | 81 +--------------------------------------- dlls/setupapi/setupapi_private.h | 1 - 3 files changed, 1 insertion(+), 101 deletions(-) diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c index 5cde5eb..c108689 100644 --- a/dlls/setupapi/parser.c +++ b/dlls/setupapi/parser.c @@ -1055,26 +1055,6 @@ const WCHAR *PARSER_get_inf_filename( HINF hinf ) return file->filename; } - -/*********************************************************************** - * PARSER_get_src_root - * - * Retrieve the source directory of an inf file. - */ -WCHAR *PARSER_get_src_root( HINF hinf ) -{ - unsigned int len; - const WCHAR *dir = get_inf_dir( hinf, &len ); - WCHAR *ret = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ); - if (ret) - { - memcpy( ret, dir, len * sizeof(WCHAR) ); - ret[len] = 0; - } - return ret; -} - - /*********************************************************************** * PARSER_get_dest_dir * diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index bc774f3..d18ce9a 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -256,82 +256,6 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification, return ret; } - -/*********************************************************************** - * get_src_file_info - * - * Retrieve the source file information for a given file. - */ -static void get_src_file_info( HINF hinf, struct file_op *op ) -{ - static const WCHAR SourceDisksNames[] = - {'S','o','u','r','c','e','D','i','s','k','s','N','a','m','e','s',0}; - static const WCHAR SourceDisksFiles[] = - {'S','o','u','r','c','e','D','i','s','k','s','F','i','l','e','s',0}; - - INFCONTEXT file_ctx, disk_ctx; - INT id, diskid; - DWORD len, len2; - - /* find the SourceDisksFiles entry */ - if (!SetupFindFirstLineW( hinf, SourceDisksFiles, op->src_file, &file_ctx )) - { - if ((op->style & (SP_COPY_SOURCE_ABSOLUTE|SP_COPY_SOURCEPATH_ABSOLUTE))) return; - /* no specific info, use .inf file source directory */ - if (!op->src_root) op->src_root = PARSER_get_src_root( hinf ); - return; - } - if (!SetupGetIntField( &file_ctx, 1, &diskid )) return; - - /* now find the diskid in the SourceDisksNames section */ - if (!SetupFindFirstLineW( hinf, SourceDisksNames, NULL, &disk_ctx )) return; - for (;;) - { - if (SetupGetIntField( &disk_ctx, 0, &id ) && (id == diskid)) break; - if (!SetupFindNextLine( &disk_ctx, &disk_ctx )) return; - } - - /* and fill in the missing info */ - - if (!op->src_descr) - { - if (SetupGetStringFieldW( &disk_ctx, 1, NULL, 0, &len ) && - (op->src_descr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ))) - SetupGetStringFieldW( &disk_ctx, 1, op->src_descr, len, NULL ); - } - if (!op->src_tag) - { - if (SetupGetStringFieldW( &disk_ctx, 2, NULL, 0, &len ) && - (op->src_tag = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ))) - SetupGetStringFieldW( &disk_ctx, 2, op->src_tag, len, NULL ); - } - if (!op->src_path && !(op->style & SP_COPY_SOURCE_ABSOLUTE)) - { - len = len2 = 0; - if (!(op->style & SP_COPY_SOURCEPATH_ABSOLUTE)) - { - /* retrieve relative path for this disk */ - if (!SetupGetStringFieldW( &disk_ctx, 4, NULL, 0, &len )) len = 0; - } - /* retrieve relative path for this file */ - if (!SetupGetStringFieldW( &file_ctx, 2, NULL, 0, &len2 )) len2 = 0; - - if ((len || len2) && - (op->src_path = HeapAlloc( GetProcessHeap(), 0, (len+len2)*sizeof(WCHAR) ))) - { - WCHAR *ptr = op->src_path; - if (len) - { - SetupGetStringFieldW( &disk_ctx, 4, op->src_path, len, NULL ); - ptr = op->src_path + strlenW(op->src_path); - if (len2 && ptr > op->src_path && ptr[-1] != '\\') *ptr++ = '\\'; - } - if (!SetupGetStringFieldW( &file_ctx, 2, ptr, len2, NULL )) *ptr = 0; - } - } - if (!op->src_root) op->src_root = PARSER_get_src_root(hinf); -} - static void get_source_info( HINF hinf, const WCHAR *src_file, SP_FILE_COPY_PARAMS_W *params, WCHAR *src_root, WCHAR *src_path) { @@ -557,10 +481,7 @@ BOOL WINAPI SetupQueueCopyIndirectW( PSP_FILE_COPY_PARAMS_W params ) /* some defaults */ if (!op->src_file) op->src_file = op->dst_file; if (params->LayoutInf) - { - get_src_file_info( params->LayoutInf, op ); - if (!op->dst_path) op->dst_path = get_destination_dir( params->LayoutInf, op->dst_file ); - } + FIXME("Unhandled LayoutInf %p.\n", params->LayoutInf); TRACE( "root=%s path=%s file=%s -> dir=%s file=%s descr=%s tag=%s\n", debugstr_w(op->src_root), debugstr_w(op->src_path), debugstr_w(op->src_file), diff --git a/dlls/setupapi/setupapi_private.h b/dlls/setupapi/setupapi_private.h index 1df96b1..f4685ab 100644 --- a/dlls/setupapi/setupapi_private.h +++ b/dlls/setupapi/setupapi_private.h @@ -90,7 +90,6 @@ static inline WCHAR *strdupAtoW( const char *str ) struct inf_file; extern const WCHAR *DIRID_get_string( int dirid ) DECLSPEC_HIDDEN; extern const WCHAR *PARSER_get_inf_filename( HINF hinf ) DECLSPEC_HIDDEN; -extern WCHAR *PARSER_get_src_root( HINF hinf ) DECLSPEC_HIDDEN; extern WCHAR *PARSER_get_dest_dir( INFCONTEXT *context ) DECLSPEC_HIDDEN; /* support for Ascii queue callback functions */
1
0
0
0
Zebediah Figura : setupapi: Implement SetupQueueCopyIndirectA() on top of the W variant.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: 466b80786fbf7ced695358af3ee87302ed00eb1b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=466b80786fbf7ced695358af…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed May 1 18:24:05 2019 -0500 setupapi: Implement SetupQueueCopyIndirectA() on top of the W variant. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/queue.c | 55 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index d0e5916..bc774f3 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -504,36 +504,35 @@ BOOL WINAPI SetupCloseFileQueue( HSPFILEQ handle ) /*********************************************************************** * SetupQueueCopyIndirectA (SETUPAPI.@) */ -BOOL WINAPI SetupQueueCopyIndirectA( PSP_FILE_COPY_PARAMS_A params ) +BOOL WINAPI SetupQueueCopyIndirectA( SP_FILE_COPY_PARAMS_A *paramsA ) { - struct file_queue *queue = params->QueueHandle; - struct file_op *op; - - if (!(op = HeapAlloc( GetProcessHeap(), 0, sizeof(*op) ))) return FALSE; - op->style = params->CopyStyle; - op->src_root = strdupAtoW( params->SourceRootPath ); - op->src_path = strdupAtoW( params->SourcePath ); - op->src_file = strdupAtoW( params->SourceFilename ); - op->src_descr = strdupAtoW( params->SourceDescription ); - op->src_tag = strdupAtoW( params->SourceTagfile ); - op->dst_path = strdupAtoW( params->TargetDirectory ); - op->dst_file = strdupAtoW( params->TargetFilename ); - - /* some defaults */ - if (!op->src_file) op->src_file = op->dst_file; - if (params->LayoutInf) - { - get_src_file_info( params->LayoutInf, op ); - if (!op->dst_path) op->dst_path = get_destination_dir( params->LayoutInf, op->dst_file ); - } - - TRACE( "root=%s path=%s file=%s -> dir=%s file=%s descr=%s tag=%s\n", - debugstr_w(op->src_root), debugstr_w(op->src_path), debugstr_w(op->src_file), - debugstr_w(op->dst_path), debugstr_w(op->dst_file), - debugstr_w(op->src_descr), debugstr_w(op->src_tag) ); + SP_FILE_COPY_PARAMS_W paramsW; + BOOL ret; - queue_file_op( &queue->copy_queue, op ); - return TRUE; + paramsW.cbSize = sizeof(paramsW); + paramsW.QueueHandle = paramsA->QueueHandle; + paramsW.SourceRootPath = strdupAtoW( paramsA->SourceRootPath ); + paramsW.SourcePath = strdupAtoW( paramsA->SourcePath ); + paramsW.SourceFilename = strdupAtoW( paramsA->SourceFilename ); + paramsW.SourceDescription = strdupAtoW( paramsA->SourceDescription ); + paramsW.SourceTagfile = strdupAtoW( paramsA->SourceTagfile ); + paramsW.TargetDirectory = strdupAtoW( paramsA->TargetDirectory ); + paramsW.TargetFilename = strdupAtoW( paramsA->TargetFilename ); + paramsW.CopyStyle = paramsA->CopyStyle; + paramsW.LayoutInf = paramsA->LayoutInf; + paramsW.SecurityDescriptor = strdupAtoW( paramsA->SecurityDescriptor ); + + ret = SetupQueueCopyIndirectW( ¶msW ); + + heap_free( (WCHAR *)paramsW.SourceRootPath ); + heap_free( (WCHAR *)paramsW.SourcePath ); + heap_free( (WCHAR *)paramsW.SourceFilename ); + heap_free( (WCHAR *)paramsW.SourceDescription ); + heap_free( (WCHAR *)paramsW.SourceTagfile ); + heap_free( (WCHAR *)paramsW.TargetDirectory ); + heap_free( (WCHAR *)paramsW.TargetFilename ); + heap_free( (WCHAR *)paramsW.SecurityDescriptor ); + return ret; }
1
0
0
0
Zebediah Figura : setupapi: Fill out all source file parameters in SetupQueueDefaultCopy().
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: 705d3eed86f3ff96ee1190dbc694148c21c4939c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=705d3eed86f3ff96ee1190db…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed May 1 18:24:04 2019 -0500 setupapi: Fill out all source file parameters in SetupQueueDefaultCopy(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/queue.c | 57 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index d9204a4..d0e5916 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -392,7 +392,7 @@ static WCHAR *get_destination_dir( HINF hinf, const WCHAR *section ) WCHAR systemdir[MAX_PATH], *dir; BOOL ret; - if (!(ret = SetupFindFirstLineW( hinf, Dest, section, &context ))) + if (!section || !(ret = SetupFindFirstLineW( hinf, Dest, section, &context ))) ret = SetupFindFirstLineW( hinf, Dest, Def, &context ); if (ret && (dir = PARSER_get_dest_dir( &context ))) @@ -626,24 +626,21 @@ BOOL WINAPI SetupQueueCopyW( HSPFILEQ queue, PCWSTR src_root, PCWSTR src_path, P /*********************************************************************** * SetupQueueDefaultCopyA (SETUPAPI.@) */ -BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, PCSTR src_root, PCSTR src_file, - PCSTR dst_file, DWORD style ) +BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, const char *src_rootA, + const char *src_fileA, const char *dst_fileA, DWORD style ) { - SP_FILE_COPY_PARAMS_A params; + WCHAR src_rootW[MAX_PATH], src_fileW[MAX_PATH], dst_fileW[MAX_PATH]; - params.cbSize = sizeof(params); - params.QueueHandle = queue; - params.SourceRootPath = src_root; - params.SourcePath = NULL; - params.SourceFilename = src_file; - params.SourceDescription = NULL; - params.SourceTagfile = NULL; - params.TargetDirectory = NULL; - params.TargetFilename = dst_file; - params.CopyStyle = style; - params.LayoutInf = hinf; - params.SecurityDescriptor = NULL; - return SetupQueueCopyIndirectA( ¶ms ); + if (!src_rootA || !src_fileA || !dst_fileA) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + MultiByteToWideChar( CP_ACP, 0, src_rootA, -1, src_rootW, ARRAY_SIZE(src_rootW) ); + MultiByteToWideChar( CP_ACP, 0, src_fileA, -1, src_fileW, ARRAY_SIZE(src_fileW) ); + MultiByteToWideChar( CP_ACP, 0, dst_fileA, -1, dst_fileW, ARRAY_SIZE(dst_fileW) ); + return SetupQueueDefaultCopyW( queue, hinf, src_rootW, src_fileW, dst_fileW, style ); } @@ -653,21 +650,39 @@ BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, PCSTR src_root, P BOOL WINAPI SetupQueueDefaultCopyW( HSPFILEQ queue, HINF hinf, PCWSTR src_root, PCWSTR src_file, PCWSTR dst_file, DWORD style ) { + WCHAR src_root_buffer[MAX_PATH], src_path[MAX_PATH]; SP_FILE_COPY_PARAMS_W params; + BOOL ret; + + if (!src_root || !src_file || !dst_file) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } params.cbSize = sizeof(params); params.QueueHandle = queue; - params.SourceRootPath = src_root; + params.SourceRootPath = src_root_buffer; params.SourcePath = NULL; params.SourceFilename = src_file; params.SourceDescription = NULL; params.SourceTagfile = NULL; - params.TargetDirectory = NULL; params.TargetFilename = dst_file; params.CopyStyle = style; - params.LayoutInf = hinf; + params.LayoutInf = NULL; params.SecurityDescriptor = NULL; - return SetupQueueCopyIndirectW( ¶ms ); + + strcpyW( src_root_buffer, src_root ); + src_path[0] = 0; + if (!(params.TargetDirectory = get_destination_dir( hinf, NULL ))) return FALSE; + get_source_info( hinf, src_file, ¶ms, src_root_buffer, src_path ); + + ret = SetupQueueCopyIndirectW( ¶ms ); + + heap_free( (WCHAR *)params.TargetDirectory ); + heap_free( (WCHAR *)params.SourceDescription ); + heap_free( (WCHAR *)params.SourceTagfile ); + return ret; }
1
0
0
0
Zebediah Figura : setupapi: Fill out all source file parameters in SetupQueueCopySection().
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: f9f25ee227a60c335ea8767e8b09d2f3bc3d53f7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f9f25ee227a60c335ea8767e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed May 1 18:24:03 2019 -0500 setupapi: Fill out all source file parameters in SetupQueueCopySection(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/queue.c | 95 ++++++++++++++++++++++++++++++++++++------- dlls/setupapi/tests/install.c | 4 +- 2 files changed, 83 insertions(+), 16 deletions(-) diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index f033ef7..d9204a4 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -33,9 +33,12 @@ #include "setupapi_private.h" #include "winver.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(setupapi); +static const WCHAR backslashW[] = {'\\',0}; + /* context structure for the default queue callback */ struct default_callback_context { @@ -329,6 +332,52 @@ static void get_src_file_info( HINF hinf, struct file_op *op ) if (!op->src_root) op->src_root = PARSER_get_src_root(hinf); } +static void get_source_info( HINF hinf, const WCHAR *src_file, SP_FILE_COPY_PARAMS_W *params, + WCHAR *src_root, WCHAR *src_path) +{ + static const WCHAR SourceDisksNames[] = + {'S','o','u','r','c','e','D','i','s','k','s','N','a','m','e','s',0}; + static const WCHAR SourceDisksFiles[] = + {'S','o','u','r','c','e','D','i','s','k','s','F','i','l','e','s',0}; + + INFCONTEXT file_ctx, disk_ctx; + INT id, diskid; + DWORD len; + + /* find the SourceDisksFiles entry */ + if (!SetupFindFirstLineW( hinf, SourceDisksFiles, src_file, &file_ctx )) return; + if (!SetupGetIntField( &file_ctx, 1, &diskid )) return; + + /* now find the diskid in the SourceDisksNames section */ + if (!SetupFindFirstLineW( hinf, SourceDisksNames, NULL, &disk_ctx )) return; + for (;;) + { + if (SetupGetIntField( &disk_ctx, 0, &id ) && (id == diskid)) break; + if (!SetupFindNextLine( &disk_ctx, &disk_ctx )) return; + } + + if (SetupGetStringFieldW( &disk_ctx, 1, NULL, 0, &len ) && len > sizeof(WCHAR) + && (params->SourceDescription = heap_alloc( len * sizeof(WCHAR) ))) + SetupGetStringFieldW( &disk_ctx, 1, (WCHAR *)params->SourceDescription, len, NULL ); + + if (SetupGetStringFieldW( &disk_ctx, 2, NULL, 0, &len ) && len > sizeof(WCHAR) + && (params->SourceTagfile = heap_alloc( len * sizeof(WCHAR) ))) + SetupGetStringFieldW( &disk_ctx, 2, (WCHAR *)params->SourceTagfile, len, NULL ); + + if (SetupGetStringFieldW( &disk_ctx, 4, NULL, 0, &len ) && len > sizeof(WCHAR) + && len < MAX_PATH - strlenW( src_root ) - 1) + { + strcatW( src_root, backslashW ); + SetupGetStringFieldW( &disk_ctx, 4, src_root + strlenW( src_root ), + MAX_PATH - strlenW( src_root ), NULL ); + } + + if (SetupGetStringFieldW( &file_ctx, 2, NULL, 0, &len ) && len > sizeof(WCHAR) && len < MAX_PATH) + { + SetupGetStringFieldW( &file_ctx, 2, src_path, MAX_PATH, NULL ); + params->SourcePath = src_path; + } +} /*********************************************************************** * get_destination_dir @@ -742,48 +791,66 @@ BOOL WINAPI SetupQueueCopySectionA( HSPFILEQ queue, PCSTR src_root, HINF hinf, H return ret; } - /*********************************************************************** * SetupQueueCopySectionW (SETUPAPI.@) */ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf, HINF hlist, PCWSTR section, DWORD style ) { - SP_FILE_COPY_PARAMS_W params; + WCHAR src_root_buffer[MAX_PATH], src_path[MAX_PATH], src_file[MAX_PATH], dst_file[MAX_PATH], *dest_dir; INFCONTEXT context; - WCHAR dest[MAX_PATH], src[MAX_PATH], *dest_dir; + SP_FILE_COPY_PARAMS_W params; INT flags; BOOL ret = FALSE; - TRACE( "hinf=%p/%p section=%s root=%s\n", - hinf, hlist, debugstr_w(section), debugstr_w(src_root) ); + TRACE("queue %p, src_root %s, hinf %p, hlist %p, section %s, style %#x.\n", + queue, debugstr_w(src_root), hinf, hlist, debugstr_w(section), style); + + if (!src_root) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } params.cbSize = sizeof(params); params.QueueHandle = queue; - params.SourceRootPath = src_root; - params.SourcePath = NULL; - params.SourceDescription = NULL; - params.SourceTagfile = NULL; - params.TargetFilename = dest; + params.SourceRootPath = src_root_buffer; + params.SourceFilename = src_file; + params.TargetFilename = dst_file; params.CopyStyle = style; - params.LayoutInf = hinf; + params.LayoutInf = NULL; params.SecurityDescriptor = NULL; + strcpyW( src_root_buffer, src_root ); + if (!hlist) hlist = hinf; if (!hinf) hinf = hlist; if (!SetupFindFirstLineW( hlist, section, NULL, &context )) return FALSE; if (!(params.TargetDirectory = dest_dir = get_destination_dir( hinf, section ))) return FALSE; do { - if (!SetupGetStringFieldW( &context, 1, dest, ARRAY_SIZE( dest ), NULL )) + params.SourcePath = NULL; + params.SourceDescription = NULL; + params.SourceTagfile = NULL; + strcpyW( src_root_buffer, src_root ); + src_path[0] = 0; + + if (!SetupGetStringFieldW( &context, 1, dst_file, ARRAY_SIZE( dst_file ), NULL )) goto end; - if (!SetupGetStringFieldW( &context, 2, src, ARRAY_SIZE( src ), NULL )) *src = 0; + if (!SetupGetStringFieldW( &context, 2, src_file, ARRAY_SIZE( src_file ), NULL )) + strcpyW( src_file, dst_file ); + if (!SetupGetIntField( &context, 4, &flags )) flags = 0; /* FIXME */ - params.SourceFilename = *src ? src : NULL; + get_source_info( hinf, src_file, ¶ms, src_root_buffer, src_path ); + if (!SetupQueueCopyIndirectW( ¶ms )) goto end; + + heap_free( (WCHAR *)params.SourceDescription ); + heap_free( (WCHAR *)params.SourceTagfile ); } while (SetupFindNextLine( &context, &context )); ret = TRUE; + end: HeapFree(GetProcessHeap(), 0, dest_dir); return ret; diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c index 7c614c7..32002a9 100644 --- a/dlls/setupapi/tests/install.c +++ b/dlls/setupapi/tests/install.c @@ -1065,8 +1065,8 @@ static void test_install_files_queue(void) ok(delete_file("dst/four.txt"), "Destination file should exist.\n"); ok(delete_file("dst/five.txt"), "Destination file should exist.\n"); ok(delete_file("dst/six.txt"), "Destination file should exist.\n"); - todo_wine ok(delete_file("dst/seven.txt"), "Destination file should exist.\n"); - todo_wine ok(delete_file("dst/eight.txt"), "Destination file should exist.\n"); + ok(delete_file("dst/seven.txt"), "Destination file should exist.\n"); + ok(delete_file("dst/eight.txt"), "Destination file should exist.\n"); SetupTermDefaultQueueCallback(context); ret = SetupCloseFileQueue(queue);
1
0
0
0
Zebediah Figura : setupapi: Avoid passing a NULL source root path to SetupQueueDefaultCopy() and SetupQueueCopySection().
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: cedbdf438770970ea5d1e32b10667d736a06c01a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cedbdf438770970ea5d1e32b…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed May 1 18:24:02 2019 -0500 setupapi: Avoid passing a NULL source root path to SetupQueueDefaultCopy() and SetupQueueCopySection(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/install.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c index 0abd716..265fbd0 100644 --- a/dlls/setupapi/install.c +++ b/dlls/setupapi/install.c @@ -155,11 +155,20 @@ static WCHAR *dup_section_line_field( HINF hinf, const WCHAR *section, const WCH static BOOL copy_files_callback( HINF hinf, PCWSTR field, void *arg ) { struct files_callback_info *info = arg; + WCHAR src_root[MAX_PATH], *p; + + if (!info->src_root) + { + strcpyW( src_root, PARSER_get_inf_filename( hinf ) ); + if ((p = strrchrW( src_root, '\\' ))) *p = 0; + } if (field[0] == '@') /* special case: copy single file */ - SetupQueueDefaultCopyW( info->queue, info->layout ? info->layout : hinf, info->src_root, NULL, field+1, info->copy_flags ); + SetupQueueDefaultCopyW( info->queue, info->layout ? info->layout : hinf, + info->src_root ? info->src_root : src_root, NULL, field+1, info->copy_flags ); else - SetupQueueCopySectionW( info->queue, info->src_root, info->layout ? info->layout : hinf, hinf, field, info->copy_flags ); + SetupQueueCopySectionW( info->queue, info->src_root ? info->src_root : src_root, + info->layout ? info->layout : hinf, hinf, field, info->copy_flags ); return TRUE; }
1
0
0
0
Alexandre Julliard : makefiles: Use a separate LDFLAGS variable for cross-compilation.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: 5d1febc9094673b93c1672e55e761c3c265e901b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d1febc9094673b93c1672e5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 2 15:59:23 2019 +0200 makefiles: Use a separate LDFLAGS variable for cross-compilation. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/makedep.c b/tools/makedep.c index d909b31..091ad2b 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2957,6 +2957,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filename( source->filename ); output_filename( obj_name ); output_filenames( all_libs ); + output_filename( crosstarget ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); } @@ -3182,6 +3183,7 @@ static void output_module( struct makefile *make ) output_filenames_obj_dir( make, need_cross ? make->crossobj_files : make->object_files ); output_filenames_obj_dir( make, make->res_files ); output_filenames( all_libs ); + output_filename( need_cross ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); if (spec_file && make->importlib) @@ -3340,6 +3342,7 @@ static void output_test_module( struct makefile *make ) output_filenames_obj_dir( make, crosstarget ? make->crossobj_files : make->object_files ); output_filenames_obj_dir( make, make->res_files ); output_filenames( all_libs ); + output_filename( crosstarget ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); output( "%s%s:\n", obj_dir_path( make, stripped ), ext ); output_winegcc_command( make, !!crosstarget ); @@ -3349,6 +3352,7 @@ static void output_test_module( struct makefile *make ) output_filenames_obj_dir( make, crosstarget ? make->crossobj_files : make->object_files ); output_filenames_obj_dir( make, make->res_files ); output_filenames( all_libs ); + output_filename( crosstarget ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); output( "\n" ); output( "%s%s %s%s:", obj_dir_path( make, testmodule ), ext, obj_dir_path( make, stripped ), ext ); output_filenames_obj_dir( make, crosstarget ? make->crossobj_files : make->object_files );
1
0
0
0
Alexandre Julliard : makefiles: Support delay imports for PE builds.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: 92233bfaf5e4cd9b0e3dfba38d0fb4890d0b0b59 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=92233bfaf5e4cd9b0e3dfba3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 2 15:56:15 2019 +0200 makefiles: Support delay imports for PE builds. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 77 +++++++++++++++++++++++++++++----------- tools/winebuild/import.c | 3 +- tools/winebuild/winebuild.man.in | 3 +- 3 files changed, 61 insertions(+), 22 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=92233bfaf5e4cd9b0e3d…
1
0
0
0
Alexandre Julliard : include: Move DECLSPEC_HOTPATCH definition out of config.h.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: d624883047db221729331c95597ef383e4cb670a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d624883047db221729331c95…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 2 16:47:55 2019 +0200 include: Move DECLSPEC_HOTPATCH definition out of config.h. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 38 -------------------------------------- configure.ac | 15 --------------- include/config.h.in | 3 --- include/winnt.h | 6 ++++++ 4 files changed, 6 insertions(+), 56 deletions(-) diff --git a/configure b/configure index 3cb8bc5..588364f 100755 --- a/configure +++ b/configure @@ -17235,44 +17235,6 @@ if test "x$ac_cv_cflags__Werror" = xyes; then : EXTRACFLAGS="$EXTRACFLAGS -Werror" fi fi - - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ms_hook_prologue attribute" >&5 -$as_echo_n "checking for ms_hook_prologue attribute... " >&6; } -if ${ac_cv_have_ms_hook_prologue+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int __attribute__((__ms_hook_prologue__)) test(void) { return 0; } -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_ms_hook_prologue="yes" -else - ac_cv_have_ms_hook_prologue="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ms_hook_prologue" >&5 -$as_echo "$ac_cv_have_ms_hook_prologue" >&6; } - CFLAGS="$saved_CFLAGS" - if test "$ac_cv_have_ms_hook_prologue" = "yes" - then - -$as_echo "#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))" >>confdefs.h - - else - $as_echo "#define DECLSPEC_HOTPATCH /* */" >>confdefs.h - - fi fi diff --git a/configure.ac b/configure.ac index cd6e61a..0ad8417 100644 --- a/configure.ac +++ b/configure.ac @@ -2031,21 +2031,6 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy= then WINE_TRY_CFLAGS([-Werror]) fi - - dnl Check for ms_hook_prologue support - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - AC_CACHE_CHECK([for ms_hook_prologue attribute], ac_cv_have_ms_hook_prologue, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int __attribute__((__ms_hook_prologue__)) test(void) { return 0; }]])], - [ac_cv_have_ms_hook_prologue="yes"],[ac_cv_have_ms_hook_prologue="no"])) - CFLAGS="$saved_CFLAGS" - if test "$ac_cv_have_ms_hook_prologue" = "yes" - then - AC_DEFINE(DECLSPEC_HOTPATCH, [__attribute__((__ms_hook_prologue__))], - [Define to a function attribute for Microsoft hotpatch assembly prefix.]) - else - AC_DEFINE(DECLSPEC_HOTPATCH, [/* */]) - fi fi dnl **** Disable Fortify, it has too many false positives diff --git a/include/config.h.in b/include/config.h.in index aeb571a..8add980 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -4,9 +4,6 @@ #define __WINE_CONFIG_H #ifndef WINE_CROSSTEST -/* Define to a function attribute for Microsoft hotpatch assembly prefix. */ -#undef DECLSPEC_HOTPATCH - /* Define to the file extension for executables. */ #undef EXEEXT diff --git a/include/winnt.h b/include/winnt.h index 0e011cd..d0d3b2c 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -162,6 +162,12 @@ extern "C" { # define DECLSPEC_HIDDEN #endif +#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))) && (defined(__i386__) || defined(__x86_64__)) +#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__)) +#else +#define DECLSPEC_HOTPATCH +#endif + #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) #else
1
0
0
0
Alexandre Julliard : include: Use DECLSPEC_HIDDEN instead of DECLSPEC_IMPORT for dll exports.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: 60ac1cec626b63130c50b1f5c61d5fd54d185dda URL:
https://source.winehq.org/git/wine.git/?a=commit;h=60ac1cec626b63130c50b1f5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 2 14:52:15 2019 +0200 include: Use DECLSPEC_HIDDEN instead of DECLSPEC_IMPORT for dll exports. DECLSPEC_IMPORT interferes with delay imports on MinGW. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dde.h | 2 +- include/ddeml.h | 2 +- include/slpublic.h | 2 +- include/winbase.h | 4 ++-- include/wincred.h | 2 +- include/wincrypt.h | 2 +- include/wingdi.h | 4 ++-- include/winnls.h | 2 +- include/winsvc.h | 2 +- include/winuser.h | 2 +- include/wmium.h | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/dde.h b/include/dde.h index 976c457..3562361 100644 --- a/include/dde.h +++ b/include/dde.h @@ -31,7 +31,7 @@ extern "C" { #ifdef _USER32_ #define WINUSERAPI #else -#define WINUSERAPI DECLSPEC_IMPORT +#define WINUSERAPI DECLSPEC_HIDDEN #endif #include <dde.rh> diff --git a/include/ddeml.h b/include/ddeml.h index e769662..39c8c50 100644 --- a/include/ddeml.h +++ b/include/ddeml.h @@ -29,7 +29,7 @@ extern "C" { #ifdef _USER32_ #define WINUSERAPI #else -#define WINUSERAPI DECLSPEC_IMPORT +#define WINUSERAPI DECLSPEC_HIDDEN #endif /* Codepage Constants diff --git a/include/slpublic.h b/include/slpublic.h index 97fa8c7..3f3a392 100644 --- a/include/slpublic.h +++ b/include/slpublic.h @@ -26,7 +26,7 @@ extern "C" { #ifdef _SLC_ #define SLCAPI #else -#define SLCAPI DECLSPEC_IMPORT +#define SLCAPI DECLSPEC_HIDDEN #endif typedef GUID SLID; diff --git a/include/winbase.h b/include/winbase.h index 6c97afe..314a8b7 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -28,13 +28,13 @@ extern "C" { #ifdef _KERNEL32_ #define WINBASEAPI #else -#define WINBASEAPI DECLSPEC_IMPORT +#define WINBASEAPI DECLSPEC_HIDDEN #endif #ifdef _ADVAPI32_ #define WINADVAPI #else -#define WINADVAPI DECLSPEC_IMPORT +#define WINADVAPI DECLSPEC_HIDDEN #endif #include <libloaderapi.h> diff --git a/include/wincred.h b/include/wincred.h index 86934b8..e8b5e67 100644 --- a/include/wincred.h +++ b/include/wincred.h @@ -26,7 +26,7 @@ extern "C" { #ifdef _ADVAPI32_ #define WINADVAPI #else -#define WINADVAPI DECLSPEC_IMPORT +#define WINADVAPI DECLSPEC_HIDDEN #endif #ifndef __SECHANDLE_DEFINED__ diff --git a/include/wincrypt.h b/include/wincrypt.h index 8d9106e..8ab503c 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -31,7 +31,7 @@ extern "C" { #ifdef _ADVAPI32_ # define WINADVAPI #else -# define WINADVAPI DECLSPEC_IMPORT +# define WINADVAPI DECLSPEC_HIDDEN #endif /* some typedefs for function parameters */ diff --git a/include/wingdi.h b/include/wingdi.h index 347ce1a..bed2c70 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -27,13 +27,13 @@ extern "C" { #ifdef _GDI32_ #define WINGDIAPI #else -#define WINGDIAPI DECLSPEC_IMPORT +#define WINGDIAPI DECLSPEC_HIDDEN #endif #ifdef _OPENGL32_ #define WGLAPI #else -#define WGLAPI DECLSPEC_IMPORT +#define WGLAPI DECLSPEC_HIDDEN #endif typedef struct _ABCFLOAT { diff --git a/include/winnls.h b/include/winnls.h index 5e5d8d1..3be5077 100644 --- a/include/winnls.h +++ b/include/winnls.h @@ -25,7 +25,7 @@ extern "C" { #endif #ifndef _NORMALIZE_ -# define WINNORMALIZEAPI DECLSPEC_IMPORT +# define WINNORMALIZEAPI DECLSPEC_HIDDEN #else # define WINNORMALIZEAPI #endif diff --git a/include/winsvc.h b/include/winsvc.h index 9db35dd..8509d17 100644 --- a/include/winsvc.h +++ b/include/winsvc.h @@ -26,7 +26,7 @@ extern "C" { #ifdef _ADVAPI32_ #define WINADVAPI #else -#define WINADVAPI DECLSPEC_IMPORT +#define WINADVAPI DECLSPEC_HIDDEN #endif /* Service database names */ diff --git a/include/winuser.h b/include/winuser.h index a489cb7..60bc473 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -20,7 +20,7 @@ #define _WINUSER_ #if !defined(_USER32_) -#define WINUSERAPI DECLSPEC_IMPORT +#define WINUSERAPI DECLSPEC_HIDDEN #else #define WINUSERAPI #endif diff --git a/include/wmium.h b/include/wmium.h index bbb13a3..887c2b4 100644 --- a/include/wmium.h +++ b/include/wmium.h @@ -22,7 +22,7 @@ #ifdef _WMI_SOURCE_ #define WMIAPI __stdcall #else -#define WMIAPI DECLSPEC_IMPORT __stdcall +#define WMIAPI DECLSPEC_HIDDEN __stdcall #endif #include <guiddef.h>
1
0
0
0
Alexandre Julliard : winefile: Build with msvcrt.
by Alexandre Julliard
02 May '19
02 May '19
Module: wine Branch: master Commit: 9c6f2e2d88af4290ceb37f32920b14c0a389fa43 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9c6f2e2d88af4290ceb37f32…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 2 11:01:24 2019 +0200 winefile: Build with msvcrt. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winefile/Makefile.in | 4 +- programs/winefile/splitpath.c | 92 ------------------------------------------- programs/winefile/winefile.c | 25 +++++------- programs/winefile/winefile.h | 34 ---------------- 4 files changed, 11 insertions(+), 144 deletions(-) diff --git a/programs/winefile/Makefile.in b/programs/winefile/Makefile.in index ae8a144..469074a 100644 --- a/programs/winefile/Makefile.in +++ b/programs/winefile/Makefile.in @@ -1,9 +1,9 @@ MODULE = winefile.exe -APPMODE = -mwindows -municode IMPORTS = uuid shell32 comdlg32 comctl32 ole32 mpr version user32 gdi32 advapi32 shlwapi +EXTRADLLFLAGS = -mwindows -municode -mno-cygwin + C_SRCS = \ - splitpath.c \ winefile.c RC_SRCS = winefile.rc diff --git a/programs/winefile/splitpath.c b/programs/winefile/splitpath.c deleted file mode 100644 index 20d7ded..0000000 --- a/programs/winefile/splitpath.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2000, 2004 Martin Fuchs - * - * 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. - * - * 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. - * - * 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 - */ - -#include "winefile.h" - - -void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext) -{ - const WCHAR* end; /* end of processed string */ - const WCHAR* p; /* search pointer */ - const WCHAR* s; /* copy pointer */ - - /* extract drive name */ - if (path[0] && path[1]==':') { - if (drv) { - *drv++ = *path++; - *drv++ = *path++; - *drv = '\0'; - } - } else if (drv) - *drv = '\0'; - - end = path + lstrlenW(path); - - /* search for begin of file extension */ - for(p=end; p>path && *--p!='\\' && *p!='/'; ) - if (*p == '.') { - end = p; - break; - } - - if (ext) - for(s=end; (*ext=*s++); ) - ext++; - - /* search for end of directory name */ - for(p=end; p>path; ) - if (*--p=='\\' || *p=='/') { - p++; - break; - } - - if (name) { - for(s=p; s<end; ) - *name++ = *s++; - - *name = '\0'; - } - - if (dir) { - for(s=path; s<p; ) - *dir++ = *s++; - - *dir = '\0'; - } -} - - -/* -void main() // test splipath() -{ - WCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; - - _wsplitpath(L"x\\y", drv, dir, name, ext); - _wsplitpath(L"x\\", drv, dir, name, ext); - _wsplitpath(L"\\x", drv, dir, name, ext); - _wsplitpath(L"x", drv, dir, name, ext); - _wsplitpath(L"", drv, dir, name, ext); - _wsplitpath(L".x", drv, dir, name, ext); - _wsplitpath(L":x", drv, dir, name, ext); - _wsplitpath(L"a:x", drv, dir, name, ext); - _wsplitpath(L"a.b:x", drv, dir, name, ext); - _wsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext); - _wsplitpath(L"abc.EFGH:12345", drv, dir, name, ext); - _wsplitpath(L"
C:/dos/command.com
", drv, dir, name, ext); -} -*/ diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index eb03ea3..d69cbcb 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -21,17 +21,10 @@ #define COBJMACROS +#include <assert.h> +#include <stdio.h> #include "winefile.h" #include "resource.h" -#include "wine/unicode.h" - -#ifndef _MAX_PATH -#define _MAX_DRIVE 3 -#define _MAX_FNAME 256 -#define _MAX_DIR _MAX_FNAME -#define _MAX_EXT _MAX_FNAME -#define _MAX_PATH 260 -#endif #ifdef NONAMELESSUNION #define UNION_MEMBER(x) DUMMYUNIONNAME.x @@ -887,8 +880,8 @@ static int compareExt(const void* arg1, const void* arg2) name1 = fd1->cFileName; name2 = fd2->cFileName; - ext1 = strrchrW(name1, '.'); - ext2 = strrchrW(name2, '.'); + ext1 = wcsrchr(name1, '.'); + ext2 = wcsrchr(name2, '.'); if (ext1) ext1++; @@ -1108,7 +1101,7 @@ static ChildWnd* alloc_child_window(LPCWSTR path, LPITEMIDLIST pidl, HWND hwnd) if (path) { - int pathlen = strlenW(path); + int pathlen = lstrlenW(path); const WCHAR *npath = path; if (path[0] == '"' && path[pathlen - 1] == '"') @@ -1560,7 +1553,7 @@ static void CheckForFileInfo(struct PropertiesDialog* dlg, HWND hwnd, LPCWSTR st VS_FIXEDFILEINFO* pFixedFileInfo = (VS_FIXEDFILEINFO*)pVal; WCHAR buffer[BUFFER_LEN]; - sprintfW(buffer, sFmt, + swprintf(buffer, ARRAY_SIZE(buffer), sFmt, HIWORD(pFixedFileInfo->dwFileVersionMS), LOWORD(pFixedFileInfo->dwFileVersionMS), HIWORD(pFixedFileInfo->dwFileVersionLS), LOWORD(pFixedFileInfo->dwFileVersionLS)); @@ -2614,7 +2607,7 @@ static BOOL is_registered_type(LPCWSTR ext) static enum FILE_TYPE get_file_type(LPCWSTR filename) { - LPCWSTR ext = strrchrW(filename, '.'); + LPCWSTR ext = wcsrchr(filename, '.'); if (!ext) ext = sEmpty; @@ -3519,7 +3512,7 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) { ChildWnd* child = (ChildWnd*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); - ASSERT(child); + assert(child); switch(nmsg) { case WM_DRAWITEM: { @@ -3849,7 +3842,7 @@ static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM { ChildWnd* child = (ChildWnd*)GetWindowLongPtrW(GetParent(hwnd), GWLP_USERDATA); Pane* pane = (Pane*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); - ASSERT(child); + assert(child); switch(nmsg) { case WM_HSCROLL: diff --git a/programs/winefile/winefile.h b/programs/winefile/winefile.h index 1ce3d4c..eac2ff0 100644 --- a/programs/winefile/winefile.h +++ b/programs/winefile/winefile.h @@ -16,25 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_LEAN_AND_MEAN -#define WIN32_EXTRA_LEAN -#define NOSERVICE -#define NOMCX -#define NOIME -#define NOCOMM -#define NOKANJI -#define NORPC -#define NOPROXYSTUB -#define NOIMAGE -#define NOTAPE - #include <windows.h> #include <commdlg.h> - -#ifdef UNICODE -#define _UNICODE -#endif - #include <locale.h> #include <time.h> @@ -42,23 +25,8 @@ #include <shellapi.h> /* for ShellExecuteW() */ #include <shlobj.h> -#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED -#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040 -#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 -#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 -#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 -#endif - - -#ifdef _DEBUG -#define ASSERT(x) {if (!(x)) DebugBreak();} -#else -#define ASSERT(x) /* nothing */ -#endif - #define BUFFER_LEN 1024 - enum IMAGE { IMG_NONE=-1, IMG_FILE=0, IMG_DOCUMENT, IMG_EXECUTABLE, IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS,IMG_OPEN_PLUS, IMG_OPEN_MINUS, @@ -129,5 +97,3 @@ typedef struct } WINEFILE_GLOBALS; extern WINEFILE_GLOBALS Globals; - -extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
1
0
0
0
← Newer
1
...
94
95
96
97
98
99
100
101
102
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
101
102
Results per page:
10
25
50
100
200