winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2006
----- 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
4 participants
696 discussions
Start a n
N
ew thread
Stefan Leichter : shell32: Export PathResolve by name.
by Alexandre Julliard
22 Feb '06
22 Feb '06
Module: wine Branch: refs/heads/master Commit: f7b678e887891021d3107d92d28c89b95c4e41c2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=f7b678e887891021d3107d9…
Author: Stefan Leichter <Stefan.Leichter(a)camLine.com> Date: Tue Feb 21 20:23:43 2006 +0100 shell32: Export PathResolve by name. --- dlls/shell32/shell32.spec | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 4e6b7ae..a3de716 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -44,7 +44,7 @@ 48 stdcall -noname PathSetDlgItemPath(long long ptr) PathSetDlgItemPathAW 49 stdcall -noname PathQualify(ptr) PathQualifyAW 50 stdcall -noname PathStripToRoot(ptr) PathStripToRootAW - 51 stdcall -noname PathResolve(str long long) PathResolveAW + 51 stdcall PathResolve(str long long) PathResolveAW 52 stdcall -noname PathGetArgs(str) PathGetArgsAW 53 stdcall DoEnvironmentSubst(long long) DoEnvironmentSubstAW 55 stdcall -noname PathQuoteSpaces(ptr) PathQuoteSpacesAW
1
0
0
0
Alexandre Julliard : kernel: Moved the get_startup_info call to ntdll.
by Alexandre Julliard
22 Feb '06
22 Feb '06
Module: wine Branch: refs/heads/master Commit: 477b3bf5667ce986d56c195558e82ea3f88d6c10 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=477b3bf5667ce986d56c195…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Feb 22 09:57:19 2006 +0100 kernel: Moved the get_startup_info call to ntdll. --- dlls/kernel/process.c | 140 +++++++++-------------------------------------- dlls/ntdll/loader.c | 5 +- dlls/ntdll/ntdll_misc.h | 2 - dlls/ntdll/thread.c | 101 +++++++++++++++++++++++++++++++--- 4 files changed, 123 insertions(+), 125 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=477b3bf5667ce986d56…
1
0
0
0
appdb/include application.php version.php test ...
by WineHQ
22 Feb '06
22 Feb '06
ChangeSet ID: 23204 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2006/02/21 20:20:02 Modified files: include : application.php version.php testResults.php Log message: Tony Lambregts <tony.lambregts(a)gmail.com> Cleanup email code Patch:
http://cvs.winehq.org/patch.py?id=23204
Old revision New revision Changes Path 1.42 1.43 +22 -23 appdb/include/application.php 1.48 1.49 +21 -25 appdb/include/version.php 1.10 1.11 +6 -4 appdb/include/testResults.php
1
0
0
0
appdb/admin adminTestResults.php
by WineHQ
22 Feb '06
22 Feb '06
ChangeSet ID: 23203 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2006/02/21 20:17:54 Modified files: admin : adminTestResults.php Log message: Tony Lambregts <tony.lambregts(a)gmail.com> Add email reply text to admin test results form. Patch:
http://cvs.winehq.org/patch.py?id=23203
Old revision New revision Changes Path 1.4 1.5 +8 -3 appdb/admin/adminTestResults.php Index: appdb/admin/adminTestResults.php diff -u -p appdb/admin/adminTestResults.php:1.4 appdb/admin/adminTestResults.php:1.5 --- appdb/admin/adminTestResults.php:1.4 22 Feb 2006 2:17:54 -0000 +++ appdb/admin/adminTestResults.php 22 Feb 2006 2:17:54 -0000 @@ -101,8 +101,10 @@ if ($_REQUEST['sub']) echo "</td></tr></table></div>\n\n"; $oTest->OutputEditor(); - - echo '<a href="'.$_SERVER['PHP_SELF'].'">Back</a>'; + echo html_frame_start("Reply text", "90%", "", 0); + echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n"; + echo '<tr valign=top><td class="color0"><b>email Text</b></td>',"\n"; + echo '<td><textarea name="replyText" style="width: 100%" cols="80" rows="10"></textarea></td></tr>',"\n"; echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n"; @@ -125,9 +127,12 @@ if ($_REQUEST['sub']) break; } echo '</td></tr>',"\n"; + echo '</table>',"\n"; echo '</form>',"\n"; + echo html_frame_end(); + + echo '<a href="'.$_SERVER['PHP_SELF'].'">Back</a>'; - echo html_frame_end(" "); } else {
1
0
0
0
Alexandre Julliard : server: Remove no longer needed fields in the init_process_done request.
by Alexandre Julliard
21 Feb '06
21 Feb '06
Module: wine Branch: refs/heads/master Commit: e27358ea5c86ec2ab0cae53af92fa561e4acb0d3 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e27358ea5c86ec2ab0cae53…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 21 20:08:19 2006 +0100 server: Remove no longer needed fields in the init_process_done request. --- dlls/ntdll/loader.c | 8 +++----- include/wine/server_protocol.h | 5 +---- server/process.c | 15 ++------------- server/protocol.def | 3 --- server/trace.c | 6 +----- 5 files changed, 7 insertions(+), 30 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 547eb51..aa23017 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2066,16 +2066,14 @@ void WINAPI LdrInitializeThunk( ULONG un SERVER_START_REQ( init_process_done ) { req->module = peb->ImageBaseAddress; - req->module_size = wm->ldr.SizeOfImage; req->entry = (char *)peb->ImageBaseAddress + nt->OptionalHeader.AddressOfEntryPoint; - /* API requires a double indirection */ - req->name = &wm->ldr.FullDllName.Buffer; req->gui = (nt->OptionalHeader.Subsystem != IMAGE_SUBSYSTEM_WINDOWS_CUI); - wine_server_add_data( req, wm->ldr.FullDllName.Buffer, wm->ldr.FullDllName.Length ); - wine_server_call( req ); + status = wine_server_call( req ); } SERVER_END_REQ; + if (status != STATUS_SUCCESS) goto error; + RtlEnterCriticalSection( &loader_section ); load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 9ba7cce..1de4531 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -261,11 +261,8 @@ struct init_process_done_request { struct request_header __header; void* module; - size_t module_size; void* entry; - void* name; int gui; - /* VARARG(filename,unicode_str); */ }; struct init_process_done_reply { @@ -4364,6 +4361,6 @@ union generic_reply struct query_symlink_reply query_symlink_reply; }; -#define SERVER_PROTOCOL_VERSION 227 +#define SERVER_PROTOCOL_VERSION 228 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/process.c b/server/process.c index 8c71334..cc88c5f 100644 --- a/server/process.c +++ b/server/process.c @@ -968,21 +968,10 @@ DECL_HANDLER(init_process_done) fatal_protocol_error( current, "init_process_done: called twice\n" ); return; } - if (!req->module) - { - fatal_protocol_error( current, "init_process_done: module base address cannot be 0\n" ); - return; - } - - /* check if main exe has been registered as a dll already */ if (!(dll = find_process_dll( process, req->module ))) { - if (!(dll = process_load_dll( process, NULL, req->module, - get_req_data(), get_req_data_size() ))) return; - dll->size = req->module_size; - dll->dbg_offset = 0; - dll->dbg_size = 0; - dll->name = req->name; + set_error( STATUS_DLL_NOT_FOUND ); + return; } /* main exe is the first in the dll list */ diff --git a/server/protocol.def b/server/protocol.def index 6d7f527..b489b26 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -255,11 +255,8 @@ struct security_descriptor /* Signal the end of the process initialization */ @REQ(init_process_done) void* module; /* main module base address */ - size_t module_size; /* main module size */ void* entry; /* process entry point */ - void* name; /* ptr to ptr to name (in process addr space) */ int gui; /* is it a GUI process? */ - VARARG(filename,unicode_str); /* file name of main exe */ @END diff --git a/server/trace.c b/server/trace.c index d1c702e..87390f1 100644 --- a/server/trace.c +++ b/server/trace.c @@ -638,12 +638,8 @@ static void dump_get_startup_info_reply( static void dump_init_process_done_request( const struct init_process_done_request *req ) { fprintf( stderr, " module=%p,", req->module ); - fprintf( stderr, " module_size=%lu,", (unsigned long)req->module_size ); fprintf( stderr, " entry=%p,", req->entry ); - fprintf( stderr, " name=%p,", req->name ); - fprintf( stderr, " gui=%d,", req->gui ); - fprintf( stderr, " filename=" ); - dump_varargs_unicode_str( cur_size ); + fprintf( stderr, " gui=%d", req->gui ); } static void dump_init_thread_request( const struct init_thread_request *req )
1
0
0
0
Aric Stewart : twain: Implment DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET.
by Alexandre Julliard
21 Feb '06
21 Feb '06
Module: wine Branch: refs/heads/master Commit: 6976e2016d28249988ed975657f704fb5682b715 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=6976e2016d28249988ed975…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Feb 21 08:41:07 2006 -0600 twain: Implment DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET. Implement the DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET code path. Along with a number of corrections and improvements to allow the actual aquiring of images to succeed. --- dlls/twain/ds_ctrl.c | 28 ++++++++- dlls/twain/ds_image.c | 154 ++++++++++++++++++++++++++++++++++++++++++++++--- dlls/twain/dsm_ctrl.c | 1 dlls/twain/twain_i.h | 1 4 files changed, 169 insertions(+), 15 deletions(-) diff --git a/dlls/twain/ds_ctrl.c b/dlls/twain/ds_ctrl.c index bc6841a..ff49c28 100644 --- a/dlls/twain/ds_ctrl.c +++ b/dlls/twain/ds_ctrl.c @@ -332,7 +332,7 @@ TW_UINT16 TWAIN_ProcessEvent (pTW_IDENTI { pEvent->TWMessage = pSource->pendingEvent.TWMessage; pSource->pendingEvent.TWMessage = MSG_NULL; - twRC = TWRC_DSEVENT; + twRC = TWRC_NOTDSEVENT; } else { @@ -360,7 +360,7 @@ TW_UINT16 TWAIN_PendingXfersEndXfer (pTW { TW_UINT16 twRC = TWRC_SUCCESS; pTW_PENDINGXFERS pPendingXfers = (pTW_PENDINGXFERS) pData; - activeDS *pSource = TWAIN_LookupSource (pData); + activeDS *pSource = TWAIN_LookupSource (pDest); TRACE("DG_CONTROL/DAT_PENDINGXFERS/MSG_ENDXFER\n"); @@ -542,9 +542,29 @@ TW_UINT16 TWAIN_SetupFileXfer2Set (pTW_I TW_UINT16 TWAIN_SetupMemXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, TW_MEMREF pData) { - FIXME ("stub!\n"); - +#ifndef HAVE_SANE return TWRC_FAILURE; +#else + activeDS *pSource = TWAIN_LookupSource (pDest); + pTW_SETUPMEMXFER pSetupMemXfer = (pTW_SETUPMEMXFER)pData; + + TRACE("DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET\n"); + if (pSource->sane_param_valid) + { + pSetupMemXfer->MinBufSize = pSource->sane_param.bytes_per_line; + pSetupMemXfer->MaxBufSize = pSource->sane_param.bytes_per_line * 8; + pSetupMemXfer->Preferred = pSource->sane_param.bytes_per_line * 2; + } + else + { + /* Guessing */ + pSetupMemXfer->MinBufSize = 2000; + pSetupMemXfer->MaxBufSize = 8000; + pSetupMemXfer->Preferred = 4000; + } + + return TWRC_SUCCESS; +#endif } /* DG_CONTROL/DAT_STATUS/MSG_GET */ diff --git a/dlls/twain/ds_image.c b/dlls/twain/ds_image.c index c9fc1b0..07ebad8 100644 --- a/dlls/twain/ds_image.c +++ b/dlls/twain/ds_image.c @@ -1,5 +1,6 @@ /* * Copyright 2000 Corel Corporation + * Copyright 2006 CodeWeavers, Aric Stewart * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -105,6 +106,8 @@ TW_UINT16 TWAIN_ImageInfoGet (pTW_IDENTI { /* return general image description information about the image about to be transferred */ status = sane_get_parameters (pSource->deviceHandle, &pSource->sane_param); + pSource->sane_param_valid = TRUE; + TRACE("Getting parameters\n"); } pImageInfo->XResolution.Whole = -1; @@ -113,20 +116,26 @@ TW_UINT16 TWAIN_ImageInfoGet (pTW_IDENTI pImageInfo->YResolution.Frac = 0; pImageInfo->ImageWidth = pSource->sane_param.pixels_per_line; pImageInfo->ImageLength = pSource->sane_param.lines; - if (pSource->sane_param.depth == 24) + + TRACE("Bits per Sample %i\n",pSource->sane_param.depth); + TRACE("Frame Format %i\n",pSource->sane_param.format); + + if (pSource->sane_param.format == 1 /*RGB*/ ) { - pImageInfo->SamplesPerPixel = 3; - pImageInfo->BitsPerSample[0] = 8; - pImageInfo->BitsPerSample[1] = 8; - pImageInfo->BitsPerSample[2] = 8; - pImageInfo->BitsPerPixel = 24; + pImageInfo->BitsPerPixel = pSource->sane_param.depth * 3; + pImageInfo->Compression = TWCP_NONE; pImageInfo->Planar = TRUE; + pImageInfo->SamplesPerPixel = 3; + pImageInfo->BitsPerSample[0] = pSource->sane_param.depth; + pImageInfo->BitsPerSample[1] = pSource->sane_param.depth; + pImageInfo->BitsPerSample[2] = pSource->sane_param.depth; pImageInfo->PixelType = TWPT_RGB; - pImageInfo->Compression = TWCP_NONE; } - else if (pSource->sane_param.depth == 8) + else { - /* FIXME: fill the image info structure for 8-bit image */ + ERR("Unhandled source frame type\n"); + twRC = TWRC_FAILURE; + pSource->twCC = TWCC_SEQERROR; } } @@ -174,9 +183,131 @@ TW_UINT16 TWAIN_ImageLayoutSet (pTW_IDEN TW_UINT16 TWAIN_ImageMemXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, TW_MEMREF pData) { - FIXME ("stub!\n"); - +#ifndef HAVE_SANE return TWRC_FAILURE; +#else + TW_UINT16 twRC = TWRC_SUCCESS; + pTW_IMAGEMEMXFER pImageMemXfer = (pTW_IMAGEMEMXFER) pData; + activeDS *pSource = TWAIN_LookupSource (pDest); + SANE_Status status = SANE_STATUS_GOOD; + + TRACE ("DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET\n"); + + if (!pSource) + { + twRC = TWRC_FAILURE; + DSM_twCC = TWCC_NODS; + } + else if (pSource->currentState < 6 || pSource->currentState > 7) + { + twRC = TWRC_FAILURE; + pSource->twCC = TWCC_SEQERROR; + } + else + { + LPBYTE buffer; + int buff_len = 0; + int consumed_len = 0; + LPBYTE ptr; + int rows; + + /* Transfer an image from the source to the application */ + if (pSource->currentState == 6) + { + status = sane_start (pSource->deviceHandle); + if (status != SANE_STATUS_GOOD) + { + WARN("sane_start: %s\n", sane_strstatus (status)); + sane_cancel (pSource->deviceHandle); + pSource->twCC = TWCC_OPERATIONERROR; + return TWRC_FAILURE; + } + + status = sane_get_parameters (pSource->deviceHandle, + &pSource->sane_param); + pSource->sane_param_valid = TRUE; + + if (status != SANE_STATUS_GOOD) + { + WARN("sane_get_parameters: %s\n", sane_strstatus (status)); + sane_cancel (pSource->deviceHandle); + pSource->twCC = TWCC_OPERATIONERROR; + return TWRC_FAILURE; + } + + TRACE("Acquiring image %dx%dx%d bits (format=%d last=%d) from sane...\n" + , pSource->sane_param.pixels_per_line, pSource->sane_param.lines, + pSource->sane_param.depth, pSource->sane_param.format, + pSource->sane_param.last_frame); + + pSource->currentState = 7; + } + + /* access memory buffer */ + if (pImageMemXfer->Memory.Length < pSource->sane_param.bytes_per_line) + { + sane_cancel (pSource->deviceHandle); + pSource->twCC = TWCC_BADVALUE; + return TWRC_FAILURE; + } + + if (pImageMemXfer->Memory.Flags & TWMF_HANDLE) + { + FIXME("Memory Handle, may not be locked correctly\n"); + buffer = LocalLock(pImageMemXfer->Memory.TheMem); + } + else + buffer = pImageMemXfer->Memory.TheMem; + + memset(buffer,0,pImageMemXfer->Memory.Length); + + ptr = buffer; + consumed_len = 0; + rows = pImageMemXfer->Memory.Length / pSource->sane_param.bytes_per_line; + + /* must fill full lines */ + while (consumed_len < (pSource->sane_param.bytes_per_line*rows) && + status == SANE_STATUS_GOOD) + { + status = sane_read (pSource->deviceHandle, ptr, + (pSource->sane_param.bytes_per_line*rows) - consumed_len , + &buff_len); + consumed_len += buff_len; + ptr += buff_len; + } + + if (status == SANE_STATUS_GOOD || status == SANE_STATUS_EOF) + { + pImageMemXfer->Compression = TWCP_NONE; + pImageMemXfer->BytesPerRow = pSource->sane_param.bytes_per_line; + pImageMemXfer->Columns = pSource->sane_param.pixels_per_line; + pImageMemXfer->Rows = rows; + pImageMemXfer->XOffset = 0; + pImageMemXfer->YOffset = 0; + pImageMemXfer->BytesWritten = consumed_len; + + if (status == SANE_STATUS_EOF) + { + TRACE("sane_read: %s\n", sane_strstatus (status)); + sane_cancel (pSource->deviceHandle); + twRC = TWRC_XFERDONE; + } + pSource->twCC = TWRC_SUCCESS; + } + else if (status != SANE_STATUS_EOF) + { + WARN("sane_read: %s\n", sane_strstatus (status)); + sane_cancel (pSource->deviceHandle); + pSource->twCC = TWCC_OPERATIONERROR; + twRC = TWRC_FAILURE; + } + } + + if (pImageMemXfer->Memory.Flags & TWMF_HANDLE) + LocalUnlock(pImageMemXfer->Memory.TheMem); + + return twRC; +#endif } /* DG_IMAGE/DAT_IMAGENATIVEXFER/MSG_GET */ @@ -222,6 +353,7 @@ TW_UINT16 TWAIN_ImageNativeXferGet (pTW_ } status = sane_get_parameters (pSource->deviceHandle, &pSource->sane_param); + pSource->sane_param_valid = TRUE; if (status != SANE_STATUS_GOOD) { WARN("sane_get_parameters: %s\n", sane_strstatus (status)); diff --git a/dlls/twain/dsm_ctrl.c b/dlls/twain/dsm_ctrl.c index 6ebff41..002a3bf 100644 --- a/dlls/twain/dsm_ctrl.c +++ b/dlls/twain/dsm_ctrl.c @@ -178,6 +178,7 @@ TW_UINT16 TWAIN_IdentityGetFirst (pTW_ID TRACE ("DG_CONTROL/DAT_IDENTITY/MSG_GETFIRST\n"); + device_list = NULL; status = sane_get_devices (&device_list, SANE_FALSE); if (status == SANE_STATUS_GOOD) { diff --git a/dlls/twain/twain_i.h b/dlls/twain/twain_i.h index bc8f664..6d98763 100644 --- a/dlls/twain/twain_i.h +++ b/dlls/twain/twain_i.h @@ -46,6 +46,7 @@ typedef struct tagActiveDS SANE_Handle deviceHandle; /* device handle */ SANE_Parameters sane_param; /* parameters about the image transferred */ + BOOL sane_param_valid; /* true if valid sane_param*/ #endif /* Capabiblities */ TW_UINT16 capXferMech; /* ICAP_XFERMECH */
1
0
0
0
Huw Davies : msxml3: Improve parse error handling a bit.
by Alexandre Julliard
21 Feb '06
21 Feb '06
Module: wine Branch: refs/heads/master Commit: cce65b70b717f0edf43af62ceecf78a269250df4 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cce65b70b717f0edf43af62…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Feb 21 11:52:25 2006 +0000 msxml3: Improve parse error handling a bit. --- dlls/msxml3/domdoc.c | 23 +++++++++++++++++++++-- dlls/msxml3/parseerror.c | 12 ++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index bfccc1e..8f0604a 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -168,6 +168,7 @@ typedef struct _domdoc VARIANT_BOOL async; IUnknown *node_unk; IXMLDOMNode *node; + HRESULT error; } domdoc; LONG xmldoc_add_ref(xmlDocPtr doc) @@ -978,8 +979,13 @@ static HRESULT WINAPI domdoc_load( return S_FALSE; xmldoc = doread( filename ); - if ( !xmldoc ) return S_FALSE; + if ( !xmldoc ) + { + This->error = E_FAIL; + return S_FALSE; + } + This->error = S_OK; xmldoc->_private = 0; attach_xmlnode(This->node, (xmlNodePtr) xmldoc); @@ -1001,8 +1007,16 @@ static HRESULT WINAPI domdoc_get_parseEr IXMLDOMDocument *iface, IXMLDOMParseError** errorObj ) { + BSTR error_string = NULL; + static const WCHAR err[] = {'e','r','r','o','r',0}; + domdoc *This = impl_from_IXMLDOMDocument( iface ); + FIXME("(%p)->(%p): creating a dummy parseError\n", iface, errorObj); - *errorObj = create_parseError(0, NULL, NULL, NULL, 0, 0, 0); + + if(This->error) + error_string = SysAllocString(err); + + *errorObj = create_parseError(This->error, NULL, error_string, NULL, 0, 0, 0); if(!*errorObj) return E_OUTOFMEMORY; return S_OK; } @@ -1094,8 +1108,12 @@ static HRESULT WINAPI domdoc_loadXML( xmldoc = doparse( str, len ); HeapFree( GetProcessHeap(), 0, str ); if ( !xmldoc ) + { + This->error = E_FAIL; return S_FALSE; + } + This->error = S_OK; xmldoc->_private = 0; attach_xmlnode( This->node, (xmlNodePtr) xmldoc ); @@ -1317,6 +1335,7 @@ HRESULT DOMDocument_create(IUnknown *pUn doc->lpVtbl = &domdoc_vtbl; doc->ref = 1; doc->async = 0; + doc->error = S_OK; doc->node_unk = create_basic_node( NULL, (IUnknown*)&doc->lpVtbl ); if(!doc->node_unk) diff --git a/dlls/msxml3/parseerror.c b/dlls/msxml3/parseerror.c index acde7cc..240d1fe 100644 --- a/dlls/msxml3/parseerror.c +++ b/dlls/msxml3/parseerror.c @@ -173,8 +173,16 @@ static HRESULT WINAPI parseError_get_rea IXMLDOMParseError *iface, BSTR *reason ) { - FIXME("\n"); - return E_NOTIMPL; + parse_error_t *This = impl_from_IXMLDOMParseError( iface ); + TRACE("(%p)->(%p)\n", This, reason); + + if(!This->reason) + { + *reason = NULL; + return S_FALSE; + } + *reason = SysAllocString(This->reason); + return S_OK; } static HRESULT WINAPI parseError_get_srcText(
1
0
0
0
Huw Davies : msxml3: Use url monikers to load xml.
by Alexandre Julliard
21 Feb '06
21 Feb '06
Module: wine Branch: refs/heads/master Commit: 7ee50b699dc599c63fc94076c2c96fe03c87463f URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=7ee50b699dc599c63fc9407…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Feb 21 11:50:59 2006 +0000 msxml3: Use url monikers to load xml. --- dlls/msxml3/Makefile.in | 2 dlls/msxml3/domdoc.c | 204 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 187 insertions(+), 19 deletions(-) diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in index 874d593..35e2fd3 100644 --- a/dlls/msxml3/Makefile.in +++ b/dlls/msxml3/Makefile.in @@ -4,7 +4,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = msxml3.dll -IMPORTS = oleaut32 advapi32 kernel32 ntdll +IMPORTS = urlmon shlwapi oleaut32 ole32 advapi32 kernel32 ntdll EXTRALIBS = -luuid $(LIBUNICODE) @XML2LIBS@ @XSLTLIBS@ EXTRAINCL = @XML2INCL@ @XSLTINCL@ diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 9e30ed5..bfccc1e 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -30,6 +30,10 @@ #include "winnls.h" #include "ole2.h" #include "msxml2.h" +#include "wininet.h" +#include "urlmon.h" +#include "winreg.h" +#include "shlwapi.h" #include "wine/debug.h" @@ -39,6 +43,124 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); #ifdef HAVE_LIBXML2 +typedef struct { + const struct IBindStatusCallbackVtbl *lpVtbl; +} bsc; + +static HRESULT WINAPI bsc_QueryInterface( + IBindStatusCallback *iface, + REFIID riid, + LPVOID *ppobj ) +{ + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IBindStatusCallback)) + { + IBindStatusCallback_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI bsc_AddRef( + IBindStatusCallback *iface ) +{ + return 2; +} + +static ULONG WINAPI bsc_Release( + IBindStatusCallback *iface ) +{ + return 1; +} + +static HRESULT WINAPI bsc_OnStartBinding( + IBindStatusCallback* iface, + DWORD dwReserved, + IBinding* pib) +{ + return S_OK; +} + +static HRESULT WINAPI bsc_GetPriority( + IBindStatusCallback* iface, + LONG* pnPriority) +{ + return S_OK; +} + +static HRESULT WINAPI bsc_OnLowResource( + IBindStatusCallback* iface, + DWORD reserved) +{ + return S_OK; +} + +static HRESULT WINAPI bsc_OnProgress( + IBindStatusCallback* iface, + ULONG ulProgress, + ULONG ulProgressMax, + ULONG ulStatusCode, + LPCWSTR szStatusText) +{ + return S_OK; +} + +static HRESULT WINAPI bsc_OnStopBinding( + IBindStatusCallback* iface, + HRESULT hresult, + LPCWSTR szError) +{ + return S_OK; +} + +static HRESULT WINAPI bsc_GetBindInfo( + IBindStatusCallback* iface, + DWORD* grfBINDF, + BINDINFO* pbindinfo) +{ + *grfBINDF = BINDF_RESYNCHRONIZE; + + return S_OK; +} + +static HRESULT WINAPI bsc_OnDataAvailable( + IBindStatusCallback* iface, + DWORD grfBSCF, + DWORD dwSize, + FORMATETC* pformatetc, + STGMEDIUM* pstgmed) +{ + return S_OK; +} + +static HRESULT WINAPI bsc_OnObjectAvailable( + IBindStatusCallback* iface, + REFIID riid, + IUnknown* punk) +{ + return S_OK; +} + +const struct IBindStatusCallbackVtbl bsc_vtbl = +{ + bsc_QueryInterface, + bsc_AddRef, + bsc_Release, + bsc_OnStartBinding, + bsc_GetPriority, + bsc_OnLowResource, + bsc_OnProgress, + bsc_OnStopBinding, + bsc_GetBindInfo, + bsc_OnDataAvailable, + bsc_OnObjectAvailable +}; + +static bsc domdoc_bsc = { &bsc_vtbl }; + typedef struct _domdoc { const struct IXMLDOMDocumentVtbl *lpVtbl; @@ -750,39 +872,85 @@ static xmlDocPtr doparse( char *ptr, int static xmlDocPtr doread( LPWSTR filename ) { - HANDLE handle, mapping; - DWORD len; xmlDocPtr xmldoc = NULL; - char *ptr; + HRESULT hr; + IBindCtx *pbc; + IStream *stream, *memstream; + WCHAR url[INTERNET_MAX_URL_LENGTH]; + BYTE buf[4096]; + DWORD read, written; TRACE("%s\n", debugstr_w( filename )); - handle = CreateFileW( filename, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, 0, NULL ); - if( handle == INVALID_HANDLE_VALUE ) - return xmldoc; + if(!PathIsURLW(filename)) + { + WCHAR fullpath[MAX_PATH]; + DWORD needed = sizeof(url)/sizeof(WCHAR); + + if(!PathSearchAndQualifyW(filename, fullpath, sizeof(fullpath)/sizeof(WCHAR))) + { + WARN("can't find path\n"); + return NULL; + } - len = GetFileSize( handle, NULL ); - if( len != INVALID_FILE_SIZE || GetLastError() == NO_ERROR ) + if(FAILED(UrlCreateFromPathW(fullpath, url, &needed, 0))) + { + ERR("can't create url from path\n"); + return NULL; + } + filename = url; + } + + hr = CreateBindCtx(0, &pbc); + if(SUCCEEDED(hr)) { - mapping = CreateFileMappingW( handle, NULL, PAGE_READONLY, 0, 0, NULL ); - if ( mapping ) + hr = RegisterBindStatusCallback(pbc, (IBindStatusCallback*)&domdoc_bsc.lpVtbl, NULL, 0); + if(SUCCEEDED(hr)) { - ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, len ); - if ( ptr ) + IMoniker *moniker; + hr = CreateURLMoniker(NULL, filename, &moniker); + if(SUCCEEDED(hr)) { - xmldoc = doparse( ptr, len ); - UnmapViewOfFile( ptr ); + hr = IMoniker_BindToStorage(moniker, pbc, NULL, &IID_IStream, (LPVOID*)&stream); + IMoniker_Release(moniker); } - CloseHandle( mapping ); } + IBindCtx_Release(pbc); + } + if(FAILED(hr)) + return NULL; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &memstream); + if(FAILED(hr)) + { + IStream_Release(stream); + return NULL; } - CloseHandle( handle ); + do + { + IStream_Read(stream, buf, sizeof(buf), &read); + hr = IStream_Write(memstream, buf, read, &written); + } while(SUCCEEDED(hr) && written != 0 && read != 0); + + if(SUCCEEDED(hr)) + { + HGLOBAL hglobal; + hr = GetHGlobalFromStream(memstream, &hglobal); + if(SUCCEEDED(hr)) + { + DWORD len = GlobalSize(hglobal); + char *ptr = GlobalLock(hglobal); + if(len != 0) + xmldoc = doparse( ptr, len ); + GlobalUnlock(hglobal); + } + } + IStream_Release(memstream); + IStream_Release(stream); return xmldoc; } - static HRESULT WINAPI domdoc_load( IXMLDOMDocument *iface, VARIANT xmlSource,
1
0
0
0
Alexandre Julliard : kernel: Use LoadLibrary to load the main exe in all cases.
by Alexandre Julliard
21 Feb '06
21 Feb '06
Module: wine Branch: refs/heads/master Commit: 2df3ad64eb9e1a4018b1cc49b1525464c939fc43 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2df3ad64eb9e1a4018b1cc4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 21 19:48:18 2006 +0100 kernel: Use LoadLibrary to load the main exe in all cases. --- dlls/kernel/process.c | 115 ++++++++++++++++--------------------------------- dlls/ntdll/loader.c | 52 +++++++++++----------- 2 files changed, 64 insertions(+), 103 deletions(-) diff --git a/dlls/kernel/process.c b/dlls/kernel/process.c index 5a7678d..8df05af 100644 --- a/dlls/kernel/process.c +++ b/dlls/kernel/process.c @@ -989,9 +989,12 @@ static void start_process( void *arg ) */ void __wine_kernel_init(void) { - WCHAR *main_exe_name, *p; - char error[1024]; - int file_exists; + static const WCHAR dotW[] = {'.',0}; + static const WCHAR exeW[] = {'.','e','x','e',0}; + + WCHAR *p, main_exe_name[MAX_PATH]; + HMODULE module; + DWORD type, error = 0; PEB *peb = NtCurrentTeb()->Peb; /* Initialize everything */ @@ -1000,9 +1003,12 @@ void __wine_kernel_init(void) __wine_main_argv++; /* remove argv[0] (wine itself) */ __wine_main_argc--; - if (!(main_exe_name = peb->ProcessParameters->ImagePathName.Buffer)) + if (peb->ProcessParameters->ImagePathName.Buffer) + { + strcpyW( main_exe_name, peb->ProcessParameters->ImagePathName.Buffer ); + } + else { - WCHAR buffer[MAX_PATH]; WCHAR exe_nameW[MAX_PATH]; if (!__wine_main_argv[0]) usage(); @@ -1013,97 +1019,52 @@ void __wine_kernel_init(void) } MultiByteToWideChar( CP_UNIXCP, 0, __wine_main_argv[0], -1, exe_nameW, MAX_PATH ); - if (!find_exe_file( exe_nameW, buffer, MAX_PATH, &main_exe_file )) + if (!SearchPathW( NULL, exe_nameW, exeW, MAX_PATH, main_exe_name, NULL ) && + !get_builtin_path( exe_nameW, exeW, main_exe_name, MAX_PATH )) { MESSAGE( "wine: cannot find '%s'\n", __wine_main_argv[0] ); ExitProcess(1); } - if (main_exe_file == INVALID_HANDLE_VALUE) - { - MESSAGE( "wine: cannot open %s\n", debugstr_w(main_exe_name) ); - ExitProcess(1); - } - RtlCreateUnicodeString( &peb->ProcessParameters->ImagePathName, buffer ); - main_exe_name = peb->ProcessParameters->ImagePathName.Buffer; } + /* if there's no extension, append a dot to prevent LoadLibrary from appending .dll */ + p = strrchrW( main_exe_name, '.' ); + if (!p || strchrW( p, '/' ) || strchrW( p, '\\' )) strcatW( main_exe_name, dotW ); + TRACE( "starting process name=%s file=%p argv[0]=%s\n", debugstr_w(main_exe_name), main_exe_file, debugstr_a(__wine_main_argv[0]) ); RtlInitUnicodeString( &NtCurrentTeb()->Peb->ProcessParameters->DllPath, MODULE_get_dll_load_path(NULL) ); - if (!main_exe_file) /* no file handle -> Winelib app */ + if (!(module = LoadLibraryExW( main_exe_name, 0, DONT_RESOLVE_DLL_REFERENCES ))) { - TRACE( "starting Winelib app %s\n", debugstr_w(main_exe_name) ); - if (open_builtin_exe_file( main_exe_name, error, sizeof(error), 0, &file_exists ) && - NtCurrentTeb()->Peb->ImageBaseAddress) - goto found; - MESSAGE( "wine: cannot open builtin exe for %s: %s\n", - debugstr_w(main_exe_name), error ); - ExitProcess(1); - } - - switch( MODULE_GetBinaryType( main_exe_file, NULL, NULL )) - { - case BINARY_PE_EXE: - TRACE( "starting Win32 binary %s\n", debugstr_w(main_exe_name) ); - if ((peb->ImageBaseAddress = LoadLibraryExW( main_exe_name, 0, DONT_RESOLVE_DLL_REFERENCES ))) - goto found; - MESSAGE( "wine: could not load %s as Win32 binary\n", debugstr_w(main_exe_name) ); - ExitProcess(1); - case BINARY_PE_DLL: - MESSAGE( "wine: %s is a DLL, not an executable\n", debugstr_w(main_exe_name) ); - ExitProcess(1); - case BINARY_UNKNOWN: - /* check for .com extension */ - if (!(p = strrchrW( main_exe_name, '.' )) || strcmpiW( p, comW )) + error = GetLastError(); + /* check for a DOS binary and start winevdm if needed */ + if (error == ERROR_BAD_EXE_FORMAT && GetBinaryTypeW( main_exe_name, &type )) { - MESSAGE( "wine: cannot determine executable type for %s\n", - debugstr_w(main_exe_name) ); - ExitProcess(1); - } - /* fall through */ - case BINARY_OS216: - case BINARY_WIN16: - case BINARY_DOS: - TRACE( "starting Win16/DOS binary %s\n", debugstr_w(main_exe_name) ); - __wine_main_argv--; - __wine_main_argc++; - __wine_main_argv[0] = "winevdm.exe"; - if (open_builtin_exe_file( winevdmW, error, sizeof(error), 0, &file_exists )) - goto found; - MESSAGE( "wine: trying to run %s, cannot open builtin library for 'winevdm.exe': %s\n", - debugstr_w(main_exe_name), error ); - ExitProcess(1); - case BINARY_UNIX_EXE: - MESSAGE( "wine: %s is a Unix binary, not supported\n", debugstr_w(main_exe_name) ); - ExitProcess(1); - case BINARY_UNIX_LIB: - { - char *unix_name; - - TRACE( "starting Winelib app %s\n", debugstr_w(main_exe_name) ); - if ((unix_name = wine_get_unix_file_name( main_exe_name )) && - wine_dlopen( unix_name, RTLD_NOW, error, sizeof(error) )) + if (type == SCS_WOW_BINARY || type == SCS_DOS_BINARY || + type == SCS_OS216_BINARY || type == SCS_PIF_BINARY) { - static const WCHAR soW[] = {'.','s','o',0}; - if ((p = strrchrW( main_exe_name, '.' )) && !strcmpW( p, soW )) - { - *p = 0; - /* update the unicode string */ - RtlInitUnicodeString( &peb->ProcessParameters->ImagePathName, main_exe_name ); - } - HeapFree( GetProcessHeap(), 0, unix_name ); - goto found; + __wine_main_argv--; + __wine_main_argc++; + __wine_main_argv[0] = "winevdm.exe"; + module = LoadLibraryExW( winevdmW, 0, DONT_RESOLVE_DLL_REFERENCES ); } - MESSAGE( "wine: could not load %s: %s\n", debugstr_w(main_exe_name), error ); - ExitProcess(1); } } - found: - CloseHandle( main_exe_file ); + if (main_exe_file) CloseHandle( main_exe_file ); + + if (!module) + { + char msg[1024]; + FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, msg, sizeof(msg), NULL ); + MESSAGE( "wine: could not load %s: %s", debugstr_w(main_exe_name), msg ); + ExitProcess(1); + } + + peb->ImageBaseAddress = module; /* build command line */ set_library_wargv( __wine_main_argv ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 2607b17..547eb51 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1271,16 +1271,6 @@ static void load_builtin_callback( void addr = module; NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &nt->OptionalHeader.SizeOfImage, MEM_SYSTEM | MEM_IMAGE, PAGE_EXECUTE_WRITECOPY ); - if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL)) - { - /* if we already have an executable, ignore this one */ - if (!NtCurrentTeb()->Peb->ImageBaseAddress) - { - NtCurrentTeb()->Peb->ImageBaseAddress = module; - return; /* don't create the modref here, will be done later on */ - } - } - /* create the MODREF */ if (!(fullname = get_builtin_fullname( builtin_load_info->filename, filename ))) @@ -1300,20 +1290,29 @@ static void load_builtin_callback( void } wm->ldr.Flags |= LDR_WINE_INTERNAL; - /* fixup imports */ + if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) && + !NtCurrentTeb()->Peb->ImageBaseAddress) /* if we already have an executable, ignore this one */ + { + NtCurrentTeb()->Peb->ImageBaseAddress = module; + } + else + { + /* fixup imports */ - load_path = builtin_load_info->load_path; - if (!load_path) load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; - if (!load_path) load_path = emptyW; - if (fixup_imports( wm, load_path ) != STATUS_SUCCESS) - { - /* the module has only be inserted in the load & memory order lists */ - RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); - /* FIXME: free the modref */ - builtin_load_info->status = STATUS_DLL_NOT_FOUND; - return; + load_path = builtin_load_info->load_path; + if (!load_path) load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; + if (!load_path) load_path = emptyW; + if (fixup_imports( wm, load_path ) != STATUS_SUCCESS) + { + /* the module has only be inserted in the load & memory order lists */ + RemoveEntryList(&wm->ldr.InLoadOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + /* FIXME: free the modref */ + builtin_load_info->status = STATUS_DLL_NOT_FOUND; + return; + } } + builtin_load_info->wm = wm; TRACE( "loaded %s %p %p\n", filename, wm, module ); @@ -2039,11 +2038,12 @@ void WINAPI LdrInitializeThunk( ULONG un IMAGE_NT_HEADERS *nt = RtlImageNtHeader( peb->ImageBaseAddress ); /* allocate the modref for the main exe (if not already done) */ - if (!(wm = get_modref( peb->ImageBaseAddress )) && - !(wm = alloc_module( peb->ImageBaseAddress, peb->ProcessParameters->ImagePathName.Buffer ))) + wm = get_modref( peb->ImageBaseAddress ); + assert( wm ); + if (wm->ldr.Flags & LDR_IMAGE_IS_DLL) { - status = STATUS_NO_MEMORY; - goto error; + ERR("%s is a dll, not an executable\n", debugstr_w(wm->ldr.FullDllName.Buffer) ); + exit(1); } wm->ldr.LoadCount = -1; /* can't unload main exe */
1
0
0
0
Alexandre Julliard : ntdll: Support loading a builtin under a different name.
by Alexandre Julliard
21 Feb '06
21 Feb '06
Module: wine Branch: refs/heads/master Commit: ca311b3f4c77564883132350d17274171dee5a20 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ca311b3f4c7756488313235…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 21 19:43:22 2006 +0100 ntdll: Support loading a builtin under a different name. Find the proper modref in that case based on the dlopen handle. --- dlls/ntdll/loader.c | 38 +++++++++++++++++++++----------------- 1 files changed, 21 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index b0e1f1f..2607b17 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1519,28 +1519,31 @@ static NTSTATUS load_builtin_dll( LPCWST if (!info.wm) { - /* The constructor wasn't called, this means the .so is already - * loaded under a different name. We can't support multiple names - * for the same module, so return an error. */ - return STATUS_INVALID_IMAGE_FORMAT; - } + PLIST_ENTRY mark, entry; - TRACE_(loaddll)( "Loaded module %s : builtin\n", debugstr_w(info.wm->ldr.FullDllName.Buffer) ); + /* The constructor wasn't called, this means the .so is already + * loaded under a different name. Try to find the wm for it. */ - info.wm->ldr.SectionHandle = handle; - if (strcmpiW( info.wm->ldr.BaseDllName.Buffer, name )) - { - /* check without .so extension */ - static const WCHAR soW[] = {'.','s','o',0}; - DWORD len = info.wm->ldr.BaseDllName.Length / sizeof(WCHAR); - if (strncmpiW( info.wm->ldr.BaseDllName.Buffer, name, len ) || strcmpiW( name + len, soW )) + mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; + for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - ERR( "loaded .so for %s but got %s instead - probably 16-bit dll\n", - debugstr_w(name), debugstr_w(info.wm->ldr.BaseDllName.Buffer) ); - /* wine_dll_unload( handle );*/ - return STATUS_INVALID_IMAGE_FORMAT; + LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); + if (mod->Flags & LDR_WINE_INTERNAL && mod->SectionHandle == handle) + { + info.wm = CONTAINING_RECORD(mod, WINE_MODREF, ldr); + TRACE( "Found already loaded module %s for builtin %s\n", + debugstr_w(info.wm->ldr.FullDllName.Buffer), debugstr_w(path) ); + break; + } } + if (!info.wm) return STATUS_INVALID_IMAGE_FORMAT; + } + else + { + TRACE_(loaddll)( "Loaded module %s : builtin\n", debugstr_w(info.wm->ldr.FullDllName.Buffer) ); + info.wm->ldr.SectionHandle = handle; } + *pwm = info.wm; return STATUS_SUCCESS; } @@ -1712,6 +1715,7 @@ static NTSTATUS load_dll( LPCWSTR load_p break; case LOADORDER_BI: nts = load_builtin_dll( load_path, filename, handle, flags, pwm ); + if (nts == STATUS_SUCCESS) break; if (!handle) break; /* nothing else we can try */ /* file is not a builtin library, try without using the specified file */ nts = load_builtin_dll( load_path, filename, 0, flags, pwm );
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
70
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
Results per page:
10
25
50
100
200