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
December 2009
----- 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
1233 discussions
Start a n
N
ew thread
Kai Blin : secur32: Pretend the NTLM provider also does Negotiate.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 9a81b032c41c694e6e902afcb51d0f7c8a8b1096 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a81b032c41c694e6e902afcb…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Tue Dec 29 16:36:18 2009 +0100 secur32: Pretend the NTLM provider also does Negotiate. We had to enable the Negotiate provider a while back so programs that expected that provider to be present would be happy. This broke programs that expect a Negotiate provider to actually do something if it is present. This fix works around that new issue by thunking all calls to Negotiate to NTLM. --- dlls/secur32/negotiate.c | 15 ++++++++++++- dlls/secur32/ntlm.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/dlls/secur32/negotiate.c b/dlls/secur32/negotiate.c index 8c36bc1..2b3ce0c 100644 --- a/dlls/secur32/negotiate.c +++ b/dlls/secur32/negotiate.c @@ -28,8 +28,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(secur32); +/* Disable for now, see longer comment for SECUR32_initNegotiateSP below */ +#if 0 static char nego_name_A[] = "Negotiate"; static WCHAR nego_name_W[] = {'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'e', 0}; +#endif static SECURITY_STATUS nego_QueryCredentialsAttributes(PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer) @@ -429,16 +432,23 @@ static const SecurityFunctionTableW negoTableW = { NULL, /* SetContextAttributesW */ }; +/* Disable for now, see comment below.*/ +#if 0 static WCHAR negotiate_comment_W[] = { 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ', 'P', 'a', 'c', 'k', 'a', 'g', 'e', ' ', 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'o', 'r', 0}; static CHAR negotiate_comment_A[] = "Microsoft Package Negotiator"; - +#endif void SECUR32_initNegotiateSP(void) { +/* Disable until we really implement a Negotiate provider. + * For now, the NTLM provider will pretend to be the Negotiate provider as well. + * Windows seems to be able to deal with it, and it makes several programs + * happy. */ +#if 0 SecureProvider *provider = SECUR32_addProvider(&negoTableA, &negoTableW, NULL); /* According to Windows, Negotiate has the following capabilities. @@ -462,5 +472,6 @@ void SECUR32_initNegotiateSP(void) const SecPkgInfoA infoA = { caps, version, rpcid, max_token, nego_name_A, negotiate_comment_A}; - SECUR32_addPackages(provider, 1L, &infoA, &infoW); + SECUR32_addPackages(provider, 1L, &infoA, &infoW); +#endif } diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 74fb2db..3313fe4 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -1967,6 +1967,51 @@ static const SecPkgInfoA infoA = { ntlm_comment_A }; +#define NEGO_COMMENT { 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ', \ + 'P', 'a', 'c', 'k', 'a', 'g', 'e', ' ', \ + 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'o', 'r', 0}; + +static CHAR nego_comment_A[] = NEGO_COMMENT; +static WCHAR nego_comment_W[] = NEGO_COMMENT; + +#define NEGO_NAME {'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'e', 0} + +static CHAR nego_name_A[] = NEGO_NAME; +static WCHAR nego_name_W[] = NEGO_NAME; + +#define NEGO_CAPS (\ + SECPKG_FLAG_INTEGRITY | \ + SECPKG_FLAG_PRIVACY | \ + SECPKG_FLAG_CONNECTION | \ + SECPKG_FLAG_MULTI_REQUIRED | \ + SECPKG_FLAG_EXTENDED_ERROR | \ + SECPKG_FLAG_IMPERSONATION | \ + SECPKG_FLAG_ACCEPT_WIN32_NAME | \ + SECPKG_FLAG_READONLY_WITH_CHECKSUM ) + +/* Not used for now, just kept here for completeness sake. We need to use the + * NTLM_MAX_BUF value. If the hack works, we might want to refactor the code a + * bit. */ +#define NEGO_MAX_TOKEN 12000 + +static const SecPkgInfoW nego_infoW = { + NEGO_CAPS, + 1, + RPC_C_AUTHN_GSS_NEGOTIATE, + NTLM_MAX_BUF, + nego_name_W, + nego_comment_W +}; + +static const SecPkgInfoA nego_infoA = { + NEGO_CAPS, + 1, + RPC_C_AUTHN_GSS_NEGOTIATE, + NTLM_MAX_BUF, + nego_name_A, + nego_comment_A +}; + void SECUR32_initNTLMSP(void) { PNegoHelper helper; @@ -1995,7 +2040,11 @@ void SECUR32_initNTLMSP(void) helper->micro >= MIN_NTLM_AUTH_MICRO_VERSION) ) { SecureProvider *provider = SECUR32_addProvider(&ntlmTableA, &ntlmTableW, NULL); + SecureProvider *nego_provider = SECUR32_addProvider(&ntlmTableA, &ntlmTableW, NULL); + SECUR32_addPackages(provider, 1L, &infoA, &infoW); + /* HACK: Also pretend this is the Negotiate provider */ + SECUR32_addPackages(nego_provider, 1L, &nego_infoA, &nego_infoW); } else {
1
0
0
0
Alexandre Julliard : user.exe: Prepend a valid bitmap header when copying a bitmap resource to a file.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 2a00c86a98a60db6e9b16d2f1a61dae67c87c1cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a00c86a98a60db6e9b16d2f1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 29 21:55:59 2009 +0100 user.exe: Prepend a valid bitmap header when copying a bitmap resource to a file. --- dlls/user.exe16/user.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c index 6b0f09a..7521c54 100644 --- a/dlls/user.exe16/user.c +++ b/dlls/user.exe16/user.c @@ -2009,13 +2009,22 @@ HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, INT16 c HBITMAP ret = 0; char *ptr; static const WCHAR prefixW[] = {'b','m','p',0}; + BITMAPFILEHEADER header; WCHAR path[MAX_PATH], filename[MAX_PATH]; HANDLE file; + DWORD size; filename[0] = 0; if (!(hRsrc = FindResource16( hinst, name, (LPCSTR)RT_BITMAP ))) return 0; if (!(handle = LoadResource16( hinst, hRsrc ))) return 0; if (!(ptr = LockResource16( handle ))) goto done; + size = SizeofResource16( hinst, hRsrc ); + + header.bfType = 0x4d42; /* 'BM' */ + header.bfReserved1 = 0; + header.bfReserved2 = 0; + header.bfSize = sizeof(header) + size; + header.bfOffBits = 0; /* not used by the 32-bit loading code */ if (!GetTempPathW( MAX_PATH, path )) goto done; if (!GetTempFileNameW( path, prefixW, 0, filename )) goto done; @@ -2023,8 +2032,10 @@ HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, INT16 c file = CreateFileW( filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 ); if (file != INVALID_HANDLE_VALUE) { - DWORD written, size = SizeofResource16( hinst, hRsrc ); - BOOL ok = WriteFile( file, ptr, size, &written, NULL ) && (written == size); + DWORD written; + BOOL ok; + ok = WriteFile( file, &header, sizeof(header), &written, NULL ) && (written == sizeof(header)); + if (ok) ok = WriteFile( file, ptr, size, &written, NULL ) && (written == size); CloseHandle( file ); if (ok) ret = LoadImageW( 0, filename, IMAGE_BITMAP, cx, cy, flags | LR_LOADFROMFILE ); }
1
0
0
0
Alexandre Julliard : makefiles: Use winebuild to create the Windows import libraries.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: c861c3e42eeae31c55c132d77ec4b8ef8c22125f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c861c3e42eeae31c55c132d77…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 12:56:16 2009 +0100 makefiles: Use winebuild to create the Windows import libraries. --- configure | 195 ------------------------------------------------- configure.ac | 3 - dlls/Makedll.rules.in | 14 ++-- 3 files changed, 6 insertions(+), 206 deletions(-) diff --git a/configure b/configure index 8b3e928..3e5f93e 100755 --- a/configure +++ b/configure @@ -664,7 +664,6 @@ LDEXECFLAGS IOKITLIB COREFOUNDATIONLIB SECURITYLIB -MINGWAR DLLWRAP DLLTOOL LDD @@ -6391,98 +6390,6 @@ else DLLWRAP="$ac_cv_prog_DLLWRAP" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MINGWAR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MINGWAR"; then - ac_cv_prog_MINGWAR="$MINGWAR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MINGWAR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MINGWAR=$ac_cv_prog_MINGWAR -if test -n "$MINGWAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGWAR" >&5 -$as_echo "$MINGWAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MINGWAR"; then - ac_ct_MINGWAR=$MINGWAR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MINGWAR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MINGWAR"; then - ac_cv_prog_ac_ct_MINGWAR="$ac_ct_MINGWAR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MINGWAR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MINGWAR=$ac_cv_prog_ac_ct_MINGWAR -if test -n "$ac_ct_MINGWAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MINGWAR" >&5 -$as_echo "$ac_ct_MINGWAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MINGWAR" = x; then - MINGWAR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MINGWAR=$ac_ct_MINGWAR - fi -else - MINGWAR="$ac_cv_prog_MINGWAR" -fi - if test "$DLLWRAP" = "false"; then LIBEXT="a" else @@ -7026,108 +6933,6 @@ fi done test -n "$CROSSCC" || CROSSCC="false" - case "$host_cpu" in - i[3456789]86*) - ac_prefix_list="i686-pc-mingw32-dlltool i586-pc-mingw32-dlltool i486-pc-mingw32-dlltool i386-pc-mingw32-dlltool i686-mingw32msvc-dlltool i586-mingw32msvc-dlltool i486-mingw32msvc-dlltool i386-mingw32msvc-dlltool i686-mingw32-dlltool i586-mingw32-dlltool i486-mingw32-dlltool i386-mingw32-dlltool " ;; - x86_64) - ac_prefix_list="x86_64-pc-mingw32-dlltool x86_64-w64-mingw32-dlltool " ;; - *) - ac_prefix_list="" ;; -esac -for ac_prog in $ac_prefix_list -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DLLTOOL" && break -done -test -n "$DLLTOOL" || DLLTOOL="false" - - case "$host_cpu" in - i[3456789]86*) - ac_prefix_list="i686-pc-mingw32-ar i586-pc-mingw32-ar i486-pc-mingw32-ar i386-pc-mingw32-ar i686-mingw32msvc-ar i586-mingw32msvc-ar i486-mingw32msvc-ar i386-mingw32msvc-ar i686-mingw32-ar i586-mingw32-ar i486-mingw32-ar i386-mingw32-ar " ;; - x86_64) - ac_prefix_list="x86_64-pc-mingw32-ar x86_64-w64-mingw32-ar " ;; - *) - ac_prefix_list="" ;; -esac -for ac_prog in $ac_prefix_list -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MINGWAR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MINGWAR"; then - ac_cv_prog_MINGWAR="$MINGWAR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MINGWAR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MINGWAR=$ac_cv_prog_MINGWAR -if test -n "$MINGWAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGWAR" >&5 -$as_echo "$MINGWAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MINGWAR" && break -done -test -n "$MINGWAR" || MINGWAR="false" - if test "$CROSSCC" != "false" then CROSSTEST="\$(CROSSTEST)" diff --git a/configure.ac b/configure.ac index 3454464..b75d74c 100644 --- a/configure.ac +++ b/configure.ac @@ -587,7 +587,6 @@ case $host_os in cygwin*|mingw32*) AC_CHECK_TOOL(DLLTOOL,dlltool,false) AC_CHECK_TOOL(DLLWRAP,dllwrap,false) - AC_CHECK_TOOL(MINGWAR,ar,false) if test "$DLLWRAP" = "false"; then LIBEXT="a" else @@ -756,8 +755,6 @@ dnl Check for cross compiler to build test programs if test "$cross_compiling" = "no" -a "$LIBEXT" != "dll" then WINE_CHECK_MINGW_PROG(CROSSCC,gcc,false) - WINE_CHECK_MINGW_PROG(DLLTOOL,dlltool,false) - WINE_CHECK_MINGW_PROG(MINGWAR,ar,false) if test "$CROSSCC" != "false" then AC_SUBST(CROSSTEST,"\$(CROSSTEST)") diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in index ab7e8fd..2ce9eda 100644 --- a/dlls/Makedll.rules.in +++ b/dlls/Makedll.rules.in @@ -9,15 +9,14 @@ # DLLFLAGS = @DLLFLAGS@ -MINGWAR = @MINGWAR@ DEFS = -D__WINESRC__ $(EXTRADEFS) BASEMODULE = $(MODULE:%.dll=%) MAINSPEC = $(BASEMODULE).spec -SPEC_DEF = $(BASEMODULE).def WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16) ALL_OBJS = @WIN16_FILES@ $(OBJS) ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS) IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o) +IMPLIBFLAGS = $(TARGETFLAGS) $(EXTRAIMPLIBFLAGS) IMPORTLIBFILE = $(IMPORTLIB:%=lib%.@IMPLIBEXT@) STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a) DLL_LDPATH = -L$(DLLDIR) $(DELAYIMPORTS:%=-L$(DLLDIR)/%) $(IMPORTS:%=-L$(DLLDIR)/%) @@ -38,17 +37,16 @@ all implib: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%) $(IMPLIB_SRCS:%=__static_implib__%): $(STATICIMPLIB) -$(SPEC_DEF) $(IMPORTLIB:%=lib%.def): $(MAINSPEC) - $(WINEBUILD) $(TARGETFLAGS) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC) +$(IMPORTLIB:%=lib%.def): $(MAINSPEC) + $(WINEBUILD) $(IMPLIBFLAGS) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS) $(RM) $@ $(AR) $(ARFLAGS) $@ $(IMPLIB_OBJS) $(RANLIB) $@ -$(IMPORTLIB:%=lib%.a): $(SPEC_DEF) $(IMPLIB_OBJS) - $(DLLTOOL) -k -l $@ -d $(SPEC_DEF) - $(MINGWAR) rs $@ $(IMPLIB_OBJS) +$(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS) + $(WINEBUILD) $(IMPLIBFLAGS) @CROSSTARGETFLAGS@ -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_OBJS) $(SUBDIRS): implib @@ -111,7 +109,7 @@ uninstall:: # Misc. rules clean:: - $(RM) $(SPEC_DEF) $(IMPORTLIBFILE) + $(RM) $(IMPORTLIBFILE) $(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.o): $(WINEBUILD)
1
0
0
0
Alexandre Julliard : winebuild: Don' t output private symbols at all when building an import library.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 054406f78c4acfcee39d8ee07510b66863c8e3bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=054406f78c4acfcee39d8ee07…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 12:50:17 2009 +0100 winebuild: Don't output private symbols at all when building an import library. --- tools/winebuild/build.h | 2 +- tools/winebuild/import.c | 2 +- tools/winebuild/main.c | 2 +- tools/winebuild/spec32.c | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 0543eb1..8e21a45 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -257,6 +257,7 @@ extern int load_res32_file( const char *name, DLLSPEC *spec ); extern void output_resources( DLLSPEC *spec ); extern void output_bin_resources( DLLSPEC *spec, unsigned int start_rva ); extern void output_fake_module( DLLSPEC *spec ); +extern void output_def_file( DLLSPEC *spec, int include_private ); extern void load_res16_file( const char *name, DLLSPEC *spec ); extern void output_res16_data( DLLSPEC *spec ); extern void output_bin_res16_data( DLLSPEC *spec ); @@ -270,7 +271,6 @@ extern void BuildRelays16(void); extern void BuildRelays32(void); extern void BuildSpec16File( DLLSPEC *spec ); extern void BuildSpec32File( DLLSPEC *spec ); -extern void BuildDef32File( DLLSPEC *spec ); extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ); extern int parse_spec_file( FILE *file, DLLSPEC *spec ); diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 648d29f..a81d564 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1319,7 +1319,7 @@ void output_import_lib( DLLSPEC *spec, char **argv ) fclose( output_file ); if (!(output_file = fopen( def_file, "w" ))) fatal_error( "Unable to create output file '%s'\n", def_file ); - BuildDef32File( spec ); + output_def_file( spec, 0 ); fclose( output_file ); output_file = NULL; diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 138ec68..d04d276 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -667,7 +667,7 @@ int main(int argc, char **argv) if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); if (!spec_file_name) fatal_error( "missing .spec file\n" ); if (!parse_input_file( spec )) break; - BuildDef32File( spec ); + output_def_file( spec, 1 ); break; case MODE_IMPLIB: if (!spec_file_name) fatal_error( "missing .spec file\n" ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 08703a2..a594deb 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -762,11 +762,11 @@ void output_fake_module( DLLSPEC *spec ) /******************************************************************* - * BuildDef32File + * output_def_file * * Build a Win32 def file from a spec file. */ -void BuildDef32File( DLLSPEC *spec ) +void output_def_file( DLLSPEC *spec, int include_private ) { DLLSPEC *spec32 = NULL; const char *name; @@ -802,6 +802,7 @@ void BuildDef32File( DLLSPEC *spec ) else continue; if (!(odp->flags & FLAG_PRIVATE)) total++; + else if (!include_private) continue; if (odp->type == TYPE_STUB) continue;
1
0
0
0
Alexandre Julliard : winebuild: Add support for building Windows import libraries.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 2fda3d6a179c0f2c74cc5d7530eccba260f87697 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2fda3d6a179c0f2c74cc5d753…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 11:51:19 2009 +0100 winebuild: Add support for building Windows import libraries. --- tools/winebuild/build.h | 1 + tools/winebuild/import.c | 49 ++++++++++++++++++++++++++++++++++++++ tools/winebuild/main.c | 12 +++++++++ tools/winebuild/winebuild.man.in | 4 +++ 4 files changed, 66 insertions(+), 0 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 7dca2d8..0543eb1 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -251,6 +251,7 @@ extern void output_get_pc_thunk(void); extern void output_module( DLLSPEC *spec ); extern void output_stubs( DLLSPEC *spec ); extern void output_imports( DLLSPEC *spec ); +extern void output_import_lib( DLLSPEC *spec, char **argv ); extern void output_exports( DLLSPEC *spec ); extern int load_res32_file( const char *name, DLLSPEC *spec ); extern void output_resources( DLLSPEC *spec ); diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 0caaffd..648d29f 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1304,3 +1304,52 @@ void output_imports( DLLSPEC *spec ) if (nb_imports || ext_link_imports.count || has_stubs(spec) || has_relays(spec)) output_get_pc_thunk(); } + +/* output an import library for a Win32 module and additional object files */ +void output_import_lib( DLLSPEC *spec, char **argv ) +{ + char *dlltool, *def_file; + char *cmd; + int err; + + if (target_platform != PLATFORM_WINDOWS) + fatal_error( "Unix-style import libraries not supported yet\n" ); + + def_file = get_temp_file_name( output_file_name, ".def" ); + fclose( output_file ); + if (!(output_file = fopen( def_file, "w" ))) + fatal_error( "Unable to create output file '%s'\n", def_file ); + BuildDef32File( spec ); + fclose( output_file ); + output_file = NULL; + + dlltool = find_tool( "dlltool", NULL ); + cmd = xmalloc( strlen(dlltool) + strlen(output_file_name) + strlen(def_file) + 12 ); + sprintf( cmd, "%s -k -l %s -d %s", dlltool, output_file_name, def_file ); + if (verbose) fprintf( stderr, "%s\n", cmd ); + err = system( cmd ); + if (err) fatal_error( "%s failed with status %d\n", dlltool, err ); + free( cmd ); + free( dlltool ); + + if (argv[0]) + { + char *ar = find_tool( "ar", NULL ); + int i, len; + + for (i = len = 0; argv[i]; i++) len += strlen(argv[i]) + 1; + cmd = xmalloc( strlen(ar) + strlen(output_file_name) + len + 5 ); + sprintf( cmd, "%s rs %s", ar, output_file_name ); + for (i = 0; argv[i]; i++) + { + strcat( cmd, " " ); + strcat( cmd, argv[i] ); + } + if (verbose) fprintf( stderr, "%s\n", cmd ); + err = system( cmd ); + if (err) fatal_error( "%s failed with status %d\n", dlltool, err ); + free( cmd ); + free( ar ); + } + output_file_name = NULL; +} diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index e81f88f..138ec68 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -100,6 +100,7 @@ enum exec_mode_values MODE_DLL, MODE_EXE, MODE_DEF, + MODE_IMPLIB, MODE_RELAY16, MODE_RELAY32, MODE_RESOURCES @@ -268,6 +269,7 @@ static const char usage_str[] = " --dll Build a .c file from a .spec or .def file\n" " --def Build a .def file from a .spec file\n" " --exe Build a .c file for an executable\n" +" --implib Build an import library\n" " --relay16 Build the 16-bit relay assembly routines\n" " --relay32 Build the 32-bit relay assembly routines\n" " --resources Build a .o file for the resource files\n\n" @@ -278,6 +280,7 @@ enum long_options_values LONG_OPT_DLL = 1, LONG_OPT_DEF, LONG_OPT_EXE, + LONG_OPT_IMPLIB, LONG_OPT_ASCMD, LONG_OPT_EXTERNAL_SYMS, LONG_OPT_FAKE_MODULE, @@ -300,6 +303,7 @@ static const struct option long_options[] = { "dll", 0, 0, LONG_OPT_DLL }, { "def", 0, 0, LONG_OPT_DEF }, { "exe", 0, 0, LONG_OPT_EXE }, + { "implib", 0, 0, LONG_OPT_IMPLIB }, { "as-cmd", 1, 0, LONG_OPT_ASCMD }, { "external-symbols", 0, 0, LONG_OPT_EXTERNAL_SYMS }, { "fake-module", 0, 0, LONG_OPT_FAKE_MODULE }, @@ -475,6 +479,9 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) set_exec_mode( MODE_EXE ); if (!spec->subsystem) spec->subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI; break; + case LONG_OPT_IMPLIB: + set_exec_mode( MODE_IMPLIB ); + break; case LONG_OPT_ASCMD: as_command = xstrdup( optarg ); break; @@ -662,6 +669,11 @@ int main(int argc, char **argv) if (!parse_input_file( spec )) break; BuildDef32File( spec ); break; + case MODE_IMPLIB: + if (!spec_file_name) fatal_error( "missing .spec file\n" ); + if (!parse_input_file( spec )) break; + output_import_lib( spec, argv ); + break; case MODE_RELAY16: if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); BuildRelays16(); diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in index d41fae7..e0dd72b 100644 --- a/tools/winebuild/winebuild.man.in +++ b/tools/winebuild/winebuild.man.in @@ -46,6 +46,10 @@ executable, and all the other object files must be listed as Build a .def file from a spec file. The .spec file is specified via the -E option. This is used when building dlls with a PE (Win32) compiler. .TP +.BI \--implib +Build a PE import library from a spec file. The .spec file is +specified via the -E option. +.TP .B \--relay16 Generate the assembly code for the 16-bit relay routines. This is for Wine internal usage only, you should never need to use this option.
1
0
0
0
Alexandre Julliard : winebuild: Recognize mingw32 as a Windows platform.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 1f00088bc8a7cab91f0a84716158a3ee84d386cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f00088bc8a7cab91f0a84716…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 12:43:31 2009 +0100 winebuild: Recognize mingw32 as a Windows platform. --- tools/winebuild/main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 3dd4fea..e81f88f 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -117,6 +117,7 @@ static const struct { "darwin", PLATFORM_APPLE }, { "freebsd", PLATFORM_FREEBSD }, { "solaris", PLATFORM_SOLARIS }, + { "mingw32", PLATFORM_WINDOWS }, { "windows", PLATFORM_WINDOWS }, { "winnt", PLATFORM_WINDOWS } };
1
0
0
0
Alexandre Julliard : winebuild: Simplify the code for finding the various build tools.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 38ca263374fcd9aa28cdaf18d15c50b0cbe5445d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=38ca263374fcd9aa28cdaf18d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 12:42:25 2009 +0100 winebuild: Simplify the code for finding the various build tools. --- tools/winebuild/build.h | 2 +- tools/winebuild/res32.c | 3 +- tools/winebuild/utils.c | 81 ++++++++++++++-------------------------------- 3 files changed, 28 insertions(+), 58 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 64ad5b1..7dca2d8 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -209,10 +209,10 @@ extern void warning( const char *msg, ... ) __attribute__ ((__format__ (__printf__, 1, 2))); extern int output( const char *format, ... ) __attribute__ ((__format__ (__printf__, 1, 2))); +extern char *find_tool( const char *name, const char * const *names ); extern const char *get_as_command(void); extern const char *get_ld_command(void); extern const char *get_nm_command(void); -extern const char *get_windres_command(void); extern char *get_temp_file_name( const char *prefix, const char *suffix ); extern void output_standard_file_header(void); extern FILE *open_input_file( const char *srcdir, const char *name ); diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c index e3d861e..6320a2e 100644 --- a/tools/winebuild/res32.c +++ b/tools/winebuild/res32.c @@ -652,13 +652,14 @@ void output_res_o_file( DLLSPEC *spec ) if (res_file) { - const char *prog = get_windres_command(); + char *prog = find_tool( "windres", NULL ); char *cmd = xmalloc( strlen(prog) + strlen(res_file) + strlen(output_file_name) + 9 ); sprintf( cmd, "%s -i %s -o %s", prog, res_file, output_file_name ); if (verbose) fprintf( stderr, "%s\n", cmd ); err = system( cmd ); if (err) fatal_error( "%s failed with status %d\n", prog, err ); free( cmd ); + free( prog ); } output_file_name = NULL; /* so we don't try to assemble it */ } diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index c0b9371..31bf691 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -199,15 +199,25 @@ int output( const char *format, ... ) } /* find a build tool in the path, trying the various names */ -static char *find_tool( const char * const *names ) +char *find_tool( const char *name, const char * const *names ) { static char **dirs; static unsigned int count, maxlen; char *p, *file; + const char *alt_names[2]; unsigned int i, len; struct stat st; + if (target_alias) + { + file = xmalloc( strlen(target_alias) + strlen(name) + 2 ); + strcpy( file, target_alias ); + strcat( file, "-" ); + strcat( file, name ); + return file; + } + if (!dirs) { char *path; @@ -230,6 +240,13 @@ static char *find_tool( const char * const *names ) for (i = 0; i < count; i++) maxlen = max( maxlen, strlen(dirs[i])+2 ); } + if (!names) + { + alt_names[0] = name; + alt_names[1] = NULL; + names = alt_names; + } + while (*names) { len = strlen(*names) + sizeof(EXEEXT) + 1; @@ -249,24 +266,15 @@ static char *find_tool( const char * const *names ) free( file ); names++; } - return NULL; + return xstrdup( name ); } const char *get_as_command(void) { if (!as_command) { - if (target_alias) - { - as_command = xmalloc( strlen(target_alias) + sizeof("-as") ); - strcpy( as_command, target_alias ); - strcat( as_command, "-as" ); - } - else - { - static const char * const commands[] = { "gas", "as", NULL }; - if (!(as_command = find_tool( commands ))) as_command = xstrdup("as"); - } + static const char * const commands[] = { "gas", "as", NULL }; + as_command = find_tool( "as", commands ); if (force_pointer_size) { @@ -284,17 +292,8 @@ const char *get_ld_command(void) { if (!ld_command) { - if (target_alias) - { - ld_command = xmalloc( strlen(target_alias) + sizeof("-ld") ); - strcpy( ld_command, target_alias ); - strcat( ld_command, "-ld" ); - } - else - { - static const char * const commands[] = { "ld", "gld", NULL }; - if (!(ld_command = find_tool( commands ))) ld_command = xstrdup("ld"); - } + static const char * const commands[] = { "ld", "gld", NULL }; + ld_command = find_tool( "ld", commands ); if (force_pointer_size) { @@ -323,42 +322,12 @@ const char *get_nm_command(void) { if (!nm_command) { - if (target_alias) - { - nm_command = xmalloc( strlen(target_alias) + sizeof("-nm") ); - strcpy( nm_command, target_alias ); - strcat( nm_command, "-nm" ); - } - else - { - static const char * const commands[] = { "nm", "gnm", NULL }; - if (!(nm_command = find_tool( commands ))) nm_command = xstrdup("nm"); - } + static const char * const commands[] = { "nm", "gnm", NULL }; + nm_command = find_tool( "nm", commands ); } return nm_command; } -const char *get_windres_command(void) -{ - static char *windres_command; - - if (!windres_command) - { - if (target_alias) - { - windres_command = xmalloc( strlen(target_alias) + sizeof("-windres") ); - strcpy( windres_command, target_alias ); - strcat( windres_command, "-windres" ); - } - else - { - static const char * const commands[] = { "windres", NULL }; - if (!(windres_command = find_tool( commands ))) windres_command = xstrdup("windres"); - } - } - return windres_command; -} - /* get a name for a temp file, automatically cleaned up on exit */ char *get_temp_file_name( const char *prefix, const char *suffix ) {
1
0
0
0
Alexandre Julliard : winebuild: Add support for generating import libs for 16-bit dlls.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 76ac103b8022a05c14724ac2edc09b3910954d5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76ac103b8022a05c14724ac2e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 12:32:17 2009 +0100 winebuild: Add support for generating import libs for 16-bit dlls. --- tools/winebuild/main.c | 1 - tools/winebuild/parser.c | 7 +++++++ tools/winebuild/spec16.c | 8 -------- tools/winebuild/spec32.c | 9 +++++++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index ae7904d..3dd4fea 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -657,7 +657,6 @@ int main(int argc, char **argv) break; case MODE_DEF: if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); - if (spec->type == SPEC_WIN16) fatal_error( "Cannot yet build .def file for 16-bit dlls\n" ); if (!spec_file_name) fatal_error( "missing .spec file\n" ); if (!parse_input_file( spec )) break; BuildDef32File( spec ); diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index d08a190..f48471c 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -744,6 +744,13 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ) int i; ORDDEF *odp; + spec32->file_name = xstrdup( spec16->file_name ); + if (spec16->characteristics & IMAGE_FILE_DLL) + { + spec32->characteristics = IMAGE_FILE_DLL; + spec32->init_func = xstrdup( "__wine_spec_dll_entry" ); + } + /* add an export for the NE module */ odp = add_entry_point( spec32 ); diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index abc090d..c06b4a1 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -860,14 +860,6 @@ void output_spec16_file( DLLSPEC *spec16 ) { DLLSPEC *spec32 = alloc_dll_spec(); - spec32->file_name = xstrdup( spec16->file_name ); - - if (spec16->characteristics & IMAGE_FILE_DLL) - { - spec32->characteristics = IMAGE_FILE_DLL; - spec32->init_func = xstrdup( "__wine_spec_dll_entry" ); - } - resolve_imports( spec16 ); add_16bit_exports( spec32, spec16 ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index c2b11af..08703a2 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -768,9 +768,17 @@ void output_fake_module( DLLSPEC *spec ) */ void BuildDef32File( DLLSPEC *spec ) { + DLLSPEC *spec32 = NULL; const char *name; int i, total; + if (spec->type == SPEC_WIN16) + { + spec32 = alloc_dll_spec(); + add_16bit_exports( spec32, spec ); + spec = spec32; + } + if (spec_file_name) output( "; File generated automatically from %s; do not edit!\n\n", spec_file_name ); @@ -835,4 +843,5 @@ void BuildDef32File( DLLSPEC *spec ) output( "\n" ); } if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name ); + if (spec32) free_dll_spec( spec32 ); }
1
0
0
0
Alexandre Julliard : winebuild: Always initialize the dll name at startup.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: 9d55475eeef3f3fce1700f6aa7ebced1656db01e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d55475eeef3f3fce1700f6aa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Dec 30 12:12:13 2009 +0100 winebuild: Always initialize the dll name at startup. --- tools/winebuild/main.c | 18 ++++++++++++++++++ tools/winebuild/spec16.c | 19 ------------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 14c1689..ae7904d 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -138,6 +138,23 @@ static void set_dll_file_name( const char *name, DLLSPEC *spec ) } } +/* set the dll name from the file name */ +static void init_dll_name( DLLSPEC *spec ) +{ + if (!spec->file_name) + { + char *p; + spec->file_name = xstrdup( output_file_name ); + if ((p = strrchr( spec->file_name, '.' ))) *p = 0; + } + if (!spec->dll_name) /* set default name from file name */ + { + char *p; + spec->dll_name = xstrdup( spec->file_name ); + if ((p = strrchr( spec->dll_name, '.' ))) *p = 0; + } +} + /* set the dll subsystem */ static void set_subsystem( const char *subsystem, DLLSPEC *spec ) { @@ -505,6 +522,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) if (spec->file_name && !strchr( spec->file_name, '.' )) strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" ); + init_dll_name( spec ); switch (target_cpu) { diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index 93c0822..abc090d 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -64,22 +64,6 @@ static inline int is_function( const ORDDEF *odp ) odp->type == TYPE_STUB); } -static void init_dll_name( DLLSPEC *spec ) -{ - if (!spec->file_name) - { - char *p; - spec->file_name = xstrdup( output_file_name ); - if ((p = strrchr( spec->file_name, '.' ))) *p = 0; - } - if (!spec->dll_name) /* set default name from file name */ - { - char *p; - spec->dll_name = xstrdup( spec->file_name ); - if ((p = strrchr( spec->dll_name, '.' ))) *p = 0; - } -} - /******************************************************************* * output_entries * @@ -853,7 +837,6 @@ static void output_module16( DLLSPEC *spec ) */ void BuildSpec16File( DLLSPEC *spec ) { - init_dll_name( spec ); output_standard_file_header(); output_module16( spec ); output_init_code( spec ); @@ -877,7 +860,6 @@ void output_spec16_file( DLLSPEC *spec16 ) { DLLSPEC *spec32 = alloc_dll_spec(); - init_dll_name( spec16 ); spec32->file_name = xstrdup( spec16->file_name ); if (spec16->characteristics & IMAGE_FILE_DLL) @@ -921,7 +903,6 @@ void output_fake_module16( DLLSPEC *spec ) unsigned int i, rsrctab, restab, namelen, modtab, imptab, enttab, cbenttab, codeseg, dataseg, rsrcdata; - init_dll_name( spec ); init_output_buffer(); rsrctab = lfanew;
1
0
0
0
Alexandre Julliard : winebuild: Support for adding 32-bit exports in 16-bit spec files.
by Alexandre Julliard
30 Dec '09
30 Dec '09
Module: wine Branch: master Commit: d097eef922d5c3e17fe67cce8011ebd2da955864 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d097eef922d5c3e17fe67cce8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Dec 28 22:42:58 2009 +0100 winebuild: Support for adding 32-bit exports in 16-bit spec files. --- tools/winebuild/build.h | 1 + tools/winebuild/parser.c | 79 +++++++++++++++++++++++++++++----------------- tools/winebuild/spec16.c | 3 ++ 3 files changed, 54 insertions(+), 29 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index e47278a..64ad5b1 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -146,6 +146,7 @@ extern enum target_platform target_platform; #define FLAG_FORWARD 0x100 /* function is a forwarded name */ #define FLAG_EXT_LINK 0x200 /* function links to an external symbol */ +#define FLAG_EXPORT32 0x400 /* 32-bit export in 16-bit spec file */ #define FLAG_CPU(cpu) (0x01000 << (cpu)) #define FLAG_CPU_MASK (FLAG_CPU(CPU_LAST + 1) - FLAG_CPU(0)) diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index 57807ed..d08a190 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -228,25 +228,17 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec ) { const char *token; unsigned int i; + int is_win32 = (spec->type == SPEC_WIN32) || (odp->flags & FLAG_EXPORT32); - switch(spec->type) + if (!is_win32 && odp->type == TYPE_STDCALL) { - case SPEC_WIN16: - if (odp->type == TYPE_STDCALL) - { - error( "'stdcall' not supported for Win16\n" ); - return 0; - } - break; - case SPEC_WIN32: - if (odp->type == TYPE_PASCAL) - { - error( "'pascal' not supported for Win32\n" ); - return 0; - } - break; - default: - break; + error( "'stdcall' not supported for Win16\n" ); + return 0; + } + if (is_win32 && odp->type == TYPE_PASCAL) + { + error( "'pascal' not supported for Win32\n" ); + return 0; } if (!(token = GetToken(0))) return 0; @@ -288,7 +280,7 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec ) return 0; } - if (spec->type == SPEC_WIN32) + if (is_win32) { if (strcmp(token, "long") && strcmp(token, "ptr") && @@ -296,7 +288,7 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec ) strcmp(token, "wstr") && strcmp(token, "double")) { - error( "Type '%s' not supported for Win32\n", token ); + error( "Type '%s' not supported for Win32 function\n", token ); return 0; } } @@ -325,7 +317,7 @@ static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec ) odp->link_name = xstrdup( token ); if (strchr( odp->link_name, '.' )) { - if (spec->type == SPEC_WIN16) + if (!is_win32) { error( "Forwarded functions not supported for Win16\n" ); return 0; @@ -421,7 +413,7 @@ static int parse_spec_extern( ORDDEF *odp, DLLSPEC *spec ) * * Parse the optional flags for an entry point in a .spec file. */ -static const char *parse_spec_flags( ORDDEF *odp ) +static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp ) { unsigned int i; const char *token; @@ -436,7 +428,12 @@ static const char *parse_spec_flags( ORDDEF *odp ) while (cpu_name) { if (!strcmp( cpu_name, "win32" )) - odp->flags |= FLAG_CPU_WIN32; + { + if (spec->type == SPEC_WIN32) + odp->flags |= FLAG_CPU_WIN32; + else + odp->flags |= FLAG_EXPORT32; + } else if (!strcmp( cpu_name, "win64" )) odp->flags |= FLAG_CPU_WIN64; else @@ -499,7 +496,13 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec ) } if (!(token = GetToken(0))) goto error; - if (*token == '-' && !(token = parse_spec_flags( odp ))) goto error; + if (*token == '-' && !(token = parse_spec_flags( spec, odp ))) goto error; + + if (ordinal == -1 && spec->type != SPEC_WIN32 && !(odp->flags & FLAG_EXPORT32)) + { + error( "'@' ordinals not supported for Win16\n" ); + goto error; + } odp->name = xstrdup( token ); odp->lineno = current_line; @@ -650,7 +653,8 @@ static void assign_names( DLLSPEC *spec ) { const char *name1 = all_names[i]->name ? all_names[i]->name : all_names[i]->export_name; const char *name2 = all_names[i+1]->name ? all_names[i+1]->name : all_names[i+1]->export_name; - if (!strcmp( name1, name2 )) + if (!strcmp( name1, name2 ) && + !((all_names[i]->flags ^ all_names[i+1]->flags) & FLAG_EXPORT32)) { current_line = max( all_names[i]->lineno, all_names[i+1]->lineno ); error( "'%s' redefined\n%s:%d: First defined here\n", @@ -737,12 +741,14 @@ static void assign_ordinals( DLLSPEC *spec ) */ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ) { + int i; ORDDEF *odp; /* add an export for the NE module */ odp = add_entry_point( spec32 ); odp->type = TYPE_EXTERN; + odp->flags = FLAG_PRIVATE; odp->name = xstrdup( "__wine_spec_dos_header" ); odp->lineno = 0; odp->ordinal = 1; @@ -752,12 +758,32 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ) { odp = add_entry_point( spec32 ); odp->type = TYPE_EXTERN; + odp->flags = FLAG_PRIVATE; odp->name = xstrdup( "__wine_spec_main_module" ); odp->lineno = 0; odp->ordinal = 2; odp->link_name = xstrdup( ".L__wine_spec_main_module" ); } + /* add the explicit win32 exports */ + + for (i = 1; i <= spec16->limit; i++) + { + ORDDEF *odp16 = spec16->ordinals[i]; + + if (!odp16 || !odp16->name) continue; + if (!(odp16->flags & FLAG_EXPORT32)) continue; + + odp = add_entry_point( spec32 ); + odp->flags = odp16->flags & ~FLAG_EXPORT32; + odp->type = odp16->type; + odp->name = xstrdup( odp16->name ); + odp->lineno = odp16->lineno; + odp->ordinal = -1; + odp->link_name = xstrdup( odp16->link_name ); + strcpy( odp->u.func.arg_types, odp16->u.func.arg_types ); + } + assign_names( spec32 ); assign_ordinals( spec32 ); } @@ -783,11 +809,6 @@ int parse_spec_file( FILE *file, DLLSPEC *spec ) if (!(token = GetToken(1))) continue; if (strcmp(token, "@") == 0) { - if (spec->type != SPEC_WIN32) - { - error( "'@' ordinals not supported for Win16\n" ); - continue; - } if (!parse_spec_ordinal( -1, spec )) continue; } else if (IsNumberString(token)) diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index a0a962f..93c0822 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -57,6 +57,7 @@ static const char * const nop_sequence[4] = static inline int is_function( const ORDDEF *odp ) { + if (odp->flags & FLAG_EXPORT32) return 0; return (odp->type == TYPE_CDECL || odp->type == TYPE_PASCAL || odp->type == TYPE_VARARGS || @@ -130,6 +131,7 @@ static void output_entry_table( DLLSPEC *spec ) int selector = 0; ORDDEF *odp = spec->ordinals[i]; if (!odp) continue; + if (odp->flags & FLAG_EXPORT32) continue; switch (odp->type) { @@ -704,6 +706,7 @@ static void output_module16( DLLSPEC *spec ) { ORDDEF *odp = spec->ordinals[i]; if (!odp || !odp->name[0]) continue; + if (odp->flags & FLAG_EXPORT32) continue; output_resident_name( odp->name, i ); } output( "\t.byte 0\n" );
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
124
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Results per page:
10
25
50
100
200