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
November 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
3 participants
792 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Don' t store the unix file descriptor in the async structure, retrieve it as needed.
by Alexandre Julliard
03 Nov '06
03 Nov '06
Module: wine Branch: master Commit: d384871bc3be5d83ae926d8f07f8fd6eaea2a7e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d384871bc3be5d83ae926d8f0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 3 11:56:51 2006 +0100 ntdll: Don't store the unix file descriptor in the async structure, retrieve it as needed. --- dlls/ntdll/file.c | 53 ++++++++++++++++++++++++----------------------------- 1 files changed, 24 insertions(+), 29 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 514a8a7..d91666a 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -286,8 +286,6 @@ typedef struct async_fileio off_t offset; int queue_apc_on_error; BOOL avail_mode; - int fd; - int needs_close; HANDLE event; } async_fileio; @@ -295,7 +293,6 @@ static void fileio_terminate(async_filei { TRACE("data: %p\n", fileio); - if (fileio->needs_close) close( fileio->fd ); if (fileio->event) NtSetEvent( fileio->event, NULL ); if (fileio->apc && @@ -382,14 +379,11 @@ #endif /*********************************************************************** * FILE_AsyncReadService (INTERNAL) - * - * This function is called while the client is waiting on the - * server, so we can't make any server calls here. */ static void WINAPI FILE_AsyncReadService(void *user, PIO_STATUS_BLOCK iosb, ULONG status) { async_fileio *fileio = (async_fileio*)user; - int result; + int fd, needs_close, result; int already = iosb->Information; TRACE("%p %p 0x%x\n", iosb, fileio->buffer, status); @@ -399,18 +393,22 @@ static void WINAPI FILE_AsyncReadService case STATUS_ALERTED: /* got some new data */ if (iosb->u.Status != STATUS_PENDING) FIXME("unexpected status %08x\n", iosb->u.Status); /* check to see if the data is ready (non-blocking) */ + if ((iosb->u.Status = server_get_unix_fd( fileio->handle, FILE_READ_DATA, &fd, &needs_close, NULL ))) + { + fileio_terminate(fileio, iosb); + break; + } if ( fileio->avail_mode ) - result = read(fileio->fd, &fileio->buffer[already], - fileio->count - already); + result = read(fd, &fileio->buffer[already], fileio->count - already); else { - result = pread(fileio->fd, &fileio->buffer[already], + result = pread(fd, &fileio->buffer[already], fileio->count - already, fileio->offset + already); if ((result < 0) && (errno == ESPIPE)) - result = read(fileio->fd, &fileio->buffer[already], - fileio->count - already); + result = read(fd, &fileio->buffer[already], fileio->count - already); } + if (needs_close) close( fd ); if (result < 0) { @@ -545,16 +543,14 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, fileio->buffer = buffer; fileio->queue_apc_on_error = 0; fileio->avail_mode = (flags & FD_FLAG_AVAILABLE); - fileio->fd = unix_handle; /* FIXME */ - fileio->needs_close = needs_close; fileio->event = hEvent; - NtResetEvent(hEvent, NULL); + if (hEvent) NtResetEvent(hEvent, NULL); + if (needs_close) close( unix_handle ); io_status->u.Status = STATUS_PENDING; ret = fileio_queue_async(fileio, io_status, TRUE); if (ret != STATUS_SUCCESS) { - if (needs_close) close( unix_handle ); if (flags & FD_FLAG_TIMEOUT) NtClose(hEvent); return ret; } @@ -625,14 +621,11 @@ done: /*********************************************************************** * FILE_AsyncWriteService (INTERNAL) - * - * This function is called while the client is waiting on the - * server, so we can't make any server calls here. */ static void WINAPI FILE_AsyncWriteService(void *ovp, IO_STATUS_BLOCK *iosb, ULONG status) { async_fileio *fileio = (async_fileio *) ovp; - int result; + int result, fd, needs_close; int already = iosb->Information; TRACE("(%p %p 0x%x)\n",iosb, fileio->buffer, status); @@ -641,17 +634,21 @@ static void WINAPI FILE_AsyncWriteServic { case STATUS_ALERTED: /* write some data (non-blocking) */ + if ((iosb->u.Status = server_get_unix_fd( fileio->handle, FILE_WRITE_DATA, &fd, &needs_close, NULL ))) + { + fileio_terminate(fileio, iosb); + break; + } if ( fileio->avail_mode ) - result = write(fileio->fd, &fileio->buffer[already], - fileio->count - already); + result = write(fd, &fileio->buffer[already], fileio->count - already); else { - result = pwrite(fileio->fd, &fileio->buffer[already], + result = pwrite(fd, &fileio->buffer[already], fileio->count - already, fileio->offset + already); if ((result < 0) && (errno == ESPIPE)) - result = write(fileio->fd, &fileio->buffer[already], - fileio->count - already); + result = write(fd, &fileio->buffer[already], fileio->count - already); } + if (needs_close) close( fd ); if (result < 0) { @@ -767,17 +764,15 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile fileio->buffer = (void*)buffer; fileio->queue_apc_on_error = 0; fileio->avail_mode = (flags & FD_FLAG_AVAILABLE); - fileio->fd = unix_handle; /* FIXME */ - fileio->needs_close = needs_close; fileio->event = hEvent; - NtResetEvent(hEvent, NULL); + if (hEvent) NtResetEvent(hEvent, NULL); + if (needs_close) close( unix_handle ); io_status->Information = 0; io_status->u.Status = STATUS_PENDING; ret = fileio_queue_async(fileio, io_status, FALSE); if (ret != STATUS_SUCCESS) { - if (needs_close) close( unix_handle ); if (flags & FD_FLAG_TIMEOUT) NtClose(hEvent); return ret; }
1
0
0
0
Alexandre Julliard : ntdll: Added a server_get_unix_fd function that avoids doing a dup() of the fd when not required.
by Alexandre Julliard
03 Nov '06
03 Nov '06
Module: wine Branch: master Commit: 9ddb9294da45ef17c315b355f123bb2c635ba18b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ddb9294da45ef17c315b355f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 3 11:38:44 2006 +0100 ntdll: Added a server_get_unix_fd function that avoids doing a dup() of the fd when not required. --- dlls/ntdll/cdrom.c | 8 ++-- dlls/ntdll/directory.c | 18 ++++---- dlls/ntdll/file.c | 86 ++++++++++++++++++-------------------- dlls/ntdll/ntdll_misc.h | 2 + dlls/ntdll/serial.c | 19 +++----- dlls/ntdll/server.c | 105 ++++++++++++++++++++++++---------------------- dlls/ntdll/tape.c | 6 +- dlls/ntdll/virtual.c | 21 ++++----- 8 files changed, 130 insertions(+), 135 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9ddb9294da45ef17c315b…
1
0
0
0
Francois Gouget : include: Fix the HeapQueryInformation() prototype.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 7c38ff6adf4e3eb06f70af2c1846efeea69676da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c38ff6adf4e3eb06f70af2c1…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Nov 2 19:58:47 2006 +0100 include: Fix the HeapQueryInformation() prototype. --- include/winbase.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/winbase.h b/include/winbase.h index 4cc64b4..3a9d93d 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1725,7 +1725,7 @@ BOOL WINAPI HeapDestroy(HANDLE); BOOL WINAPI HeapFree(HANDLE,DWORD,LPVOID); BOOL WINAPI HeapLock(HANDLE); LPVOID WINAPI HeapReAlloc(HANDLE,DWORD,LPVOID,SIZE_T); -BOOL WINAPI HeapQueryInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T); +BOOL WINAPI HeapQueryInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T); BOOL WINAPI HeapSetInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T); SIZE_T WINAPI HeapSize(HANDLE,DWORD,LPVOID); BOOL WINAPI HeapUnlock(HANDLE);
1
0
0
0
Francois Gouget : winhelp: Add missing '\n' in Wine trace.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: dc6731eb85bea0103a49ea4c21a14d0e54aa6e1d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc6731eb85bea0103a49ea4c2…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Nov 2 19:58:32 2006 +0100 winhelp: Add missing '\n' in Wine trace. --- programs/winhelp/macro.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 712ff18..ca67dcf 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -682,7 +682,7 @@ void CALLBACK MACRO_JumpContext(LPCSTR l { HLPFILE* hlpfile; - WINE_TRACE("(\"%s\", \"%s\", %d)", lpszPath, lpszWindow, context); + WINE_TRACE("(\"%s\", \"%s\", %d)\n", lpszPath, lpszWindow, context); hlpfile = WINHELP_LookupHelpFile(lpszPath); /* Some madness: what user calls 'context', hlpfile calls 'map' */ WINHELP_CreateHelpWindowByMap(hlpfile, context,
1
0
0
0
Rob Shearman : secur32: Make the path to ntlm_auth easier to change by moving the executable name to the top of ntlm .c.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 7be48539115f26ed9879f8bda1f3bdd206e52bd4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7be48539115f26ed9879f8bda…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Thu Nov 2 16:50:40 2006 +0000 secur32: Make the path to ntlm_auth easier to change by moving the executable name to the top of ntlm.c. --- dlls/secur32/ntlm.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 95c8758..6c340d2 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -35,6 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(secur32); #define NTLM_MAX_BUF 1904 +static CHAR ntlm_auth[] = "ntlm_auth"; + /*********************************************************************** * QueryCredentialsAttributesA */ @@ -87,8 +89,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac { SECURITY_STATUS ret; PNegoHelper helper = NULL; - static CHAR ntlm_auth[] = "ntlm_auth", - server_helper_protocol[] = "--helper-protocol=squid-2.5-ntlmssp", + static CHAR server_helper_protocol[] = "--helper-protocol=squid-2.5-ntlmssp", credentials_argv[] = "--use-cached-creds"; SEC_CHAR *client_user_arg = NULL; @@ -108,7 +109,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac switch(fCredentialUse) { case SECPKG_CRED_INBOUND: - if( (ret = fork_helper(&helper, "ntlm_auth", server_argv)) != + if( (ret = fork_helper(&helper, ntlm_auth, server_argv)) != SEC_E_OK) { phCredential = NULL; @@ -126,7 +127,6 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac { static const char username_arg[] = "--username="; static const char domain_arg[] = "--domain="; - static char ntlm_auth[] = "ntlm_auth"; static char helper_protocol[] = "--helper-protocol=ntlmssp-client-1"; int unixcp_size; @@ -200,7 +200,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac client_argv[4] = credentials_argv; client_argv[5] = NULL; - if((ret = fork_helper(&helper, "ntlm_auth", client_argv)) != + if((ret = fork_helper(&helper, ntlm_auth, client_argv)) != SEC_E_OK) { phCredential = NULL; @@ -1609,15 +1609,14 @@ void SECUR32_initNTLMSP(void) { SECURITY_STATUS ret; PNegoHelper helper; - static CHAR ntlm_auth[] = "ntlm_auth", - version[] = "--version"; + static CHAR version[] = "--version"; SEC_CHAR *args[] = { ntlm_auth, version, NULL }; - if((ret = fork_helper(&helper, "ntlm_auth", args)) != SEC_E_OK) + if((ret = fork_helper(&helper, ntlm_auth, args)) != SEC_E_OK) { /* Cheat and allocate a helper anyway, so cleanup later will work. */ helper = HeapAlloc(GetProcessHeap(),0, sizeof(PNegoHelper)); @@ -1633,8 +1632,9 @@ void SECUR32_initNTLMSP(void) } else { - ERR("ntlm_auth was not found or is outdated. " - "Make sure that ntlm_auth >= 3.x is in your path.\n"); + ERR("%s was not found or is outdated. " + "Make sure that ntlm_auth >= 3.x is in your path.\n", + ntlm_auth); } cleanup_helper(helper); }
1
0
0
0
Rob Shearman : wininet: Don't return an error for INTERNET_OPTION_SEND/ RECEIVE_TIMEOUT not being implemented
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 01425f603afec2211fae35c4bb1c6ba31815bd12 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=01425f603afec2211fae35c4b…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Thu Nov 2 16:49:19 2006 +0000 wininet: Don't return an error for INTERNET_OPTION_SEND/RECEIVE_TIMEOUT not being implemented on protocols other than HTTP, just print a FIXME. Reported by Michael Moss. --- dlls/wininet/internet.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 27a3382..607d4d8 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -2397,8 +2397,6 @@ BOOL WINAPI InternetSetOptionW(HINTERNET { FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT not supported on protocol %d\n", lpwhh->htype); - INTERNET_SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; } } else
1
0
0
0
Andrey Turkin : atl: Implement AtlAxCreateDialogA and AtlAxCreateDialogW.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 7dff8c19ee1948fe5373fd70d2ef69604905c3d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7dff8c19ee1948fe5373fd70d…
Author: Andrey Turkin <pancha(a)mail.nnov.ru> Date: Mon Oct 30 21:48:24 2006 +0300 atl: Implement AtlAxCreateDialogA and AtlAxCreateDialogW. --- dlls/atl/atl.spec | 4 +- dlls/atl/atl_ax.c | 206 +++++++++++++++++++++++++++++++++++++++++++++++++ dlls/atl/atliface.idl | 4 + 3 files changed, 212 insertions(+), 2 deletions(-) diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec index db9ca9a..12d5a19 100644 --- a/dlls/atl/atl.spec +++ b/dlls/atl/atl.spec @@ -28,8 +28,8 @@ 34 stub AtlGetVersion 35 stub AtlAxDialogBoxW 36 stub AtlAxDialogBoxA -37 stub AtlAxCreateDialogW -38 stub AtlAxCreateDialogA +37 stdcall AtlAxCreateDialogW(long wstr long ptr long) +38 stdcall AtlAxCreateDialogA(long str long ptr long) 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) 40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) 41 stub AtlAxAttachControl diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c index 1170cb8..bb393f1 100644 --- a/dlls/atl/atl_ax.c +++ b/dlls/atl/atl_ax.c @@ -221,3 +221,209 @@ HRESULT WINAPI AtlAxAttachControl(IUnkno FIXME( "(%p %p %p) - stub\n", pControl, hWnd, ppUnkContainer ); return E_NOTIMPL; } + +/********************************************************************** + * Helper function for AX_ConvertDialogTemplate + */ +static inline BOOL advance_array(WORD **pptr, DWORD *palloc, DWORD *pfilled, const WORD *data, DWORD size) +{ + if ( (*pfilled + size) > *palloc ) + { + *palloc = ((*pfilled+size) + 0xFF) & ~0xFF; + *pptr = HeapReAlloc( GetProcessHeap(), 0, *pptr, *palloc * sizeof(WORD) ); + if (!*pptr) + return FALSE; + } + RtlMoveMemory( *pptr+*pfilled, data, size * sizeof(WORD) ); + *pfilled += size; + return TRUE; +} + +/********************************************************************** + * Convert ActiveX control templates to AtlAxWin class instances + */ +static LPDLGTEMPLATEW AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl) +{ +#define GET_WORD(x) (*(const WORD *)(x)) +#define GET_DWORD(x) (*(const DWORD *)(x)) +#define PUT_BLOCK(x,y) do {if (!advance_array(&output, &allocated, &filled, (x), (y))) return NULL;} while (0) +#define PUT_WORD(x) do {WORD w = (x);PUT_BLOCK(&w, 1);} while(0) +#define PUT_DWORD(x) do {DWORD w = (x);PUT_BLOCK(&w, 2);} while(0) + const WORD *tmp, *src = (const WORD *)src_tmpl; + WORD *output; + DWORD allocated, filled; /* in WORDs */ + BOOL ext; + WORD signature, dlgver, rescount; + DWORD style; + + filled = 0; allocated = 256; + output = HeapAlloc( GetProcessHeap(), 0, allocated * sizeof(WORD) ); + if (!output) + return NULL; + + /* header */ + tmp = src; + signature = GET_WORD(src); + dlgver = GET_WORD(src + 1); + if (signature == 1 && dlgver == 0xFFFF) + { + ext = TRUE; + src += 6; + style = GET_DWORD(src); + src += 2; + rescount = GET_WORD(src++); + src += 4; + if ( GET_WORD(src) == 0xFFFF ) /* menu */ + src += 2; + else + src += strlenW(src) + 1; + if ( GET_WORD(src) == 0xFFFF ) /* class */ + src += 2; + else + src += strlenW(src) + 1; + src += strlenW(src) + 1; /* title */ + if ( style & (DS_SETFONT | DS_SHELLFONT) ) + { + src += 3; + src += strlenW(src) + 1; + } + } else { + ext = FALSE; + style = GET_DWORD(src); + src += 4; + rescount = GET_WORD(src++); + src += 4; + if ( GET_WORD(src) == 0xFFFF ) /* menu */ + src += 2; + else + src += strlenW(src) + 1; + if ( GET_WORD(src) == 0xFFFF ) /* class */ + src += 2; + else + src += strlenW(src) + 1; + src += strlenW(src) + 1; /* title */ + if ( style & DS_SETFONT ) + { + src++; + src += strlenW(src) + 1; + } + } + PUT_BLOCK(tmp, src-tmp); + + while(rescount--) + { + src = (const WORD *)( ( ((ULONG)src) + 3) & ~3); /* align on DWORD boundary */ + filled = (filled + 1) & ~1; /* depends on DWORD-aligned allocation unit */ + + tmp = src; + if (ext) + src += 11; + else + src += 9; + PUT_BLOCK(tmp, src-tmp); + + tmp = src; + if ( GET_WORD(src) == 0xFFFF ) /* class */ + { + src += 2; + } else + { + src += strlenW(src) + 1; + } + src += strlenW(src) + 1; /* title */ + if ( GET_WORD(tmp) == '{' ) /* all this mess created because of this line */ + { + const WCHAR AtlAxWin[9]={'A','t','l','A','x','W','i','n',0}; + PUT_BLOCK(AtlAxWin, sizeof(AtlAxWin)/sizeof(WORD)); + PUT_BLOCK(tmp, strlenW(tmp)+1); + } else + PUT_BLOCK(tmp, src-tmp); + + if ( GET_WORD(src) ) + { + WORD size = (GET_WORD(src)+sizeof(WORD)-1) / sizeof(WORD); /* quite ugly :( Maybe use BYTE* instead of WORD* everywhere ? */ + PUT_BLOCK(src, size); + src+=size; + } + else + { + PUT_WORD(0); + src++; + } + } + return (LPDLGTEMPLATEW) output; +} + +/*********************************************************************** + * AtlAxCreateDialogA [ATL.@] + * + * Creates a dialog window + * + * PARAMS + * hInst [I] Application instance + * name [I] Dialog box template name + * owner [I] Dialog box parent HWND + * dlgProc [I] Dialog box procedure + * param [I] This value will be passed to dlgProc as WM_INITDIALOG's message lParam + * + * RETURNS + * Window handle of dialog window. + */ +HWND WINAPI AtlAxCreateDialogA(HINSTANCE hInst, LPCSTR name, HWND owner, DLGPROC dlgProc ,LPARAM param) +{ + HWND res = NULL; + int length; + WCHAR *nameW; + + if ( HIWORD(name) == 0 ) + return AtlAxCreateDialogW( hInst, (LPCWSTR) name, owner, dlgProc, param ); + + length = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 ); + nameW = HeapAlloc( GetProcessHeap(), 0, length * sizeof(WCHAR) ); + if (nameW) + { + MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, length ); + res = AtlAxCreateDialogW( hInst, nameW, owner, dlgProc, param ); + HeapFree( GetProcessHeap(), 0, nameW ); + } + return res; +} + +/*********************************************************************** + * AtlAxCreateDialogW [ATL.@] + * + * See AtlAxCreateDialogA + * + */ +HWND WINAPI AtlAxCreateDialogW(HINSTANCE hInst, LPCWSTR name, HWND owner, DLGPROC dlgProc ,LPARAM param) +{ + HRSRC hrsrc; + HGLOBAL hgl; + LPCDLGTEMPLATEW ptr; + LPDLGTEMPLATEW newptr; + HWND res; + + FIXME("(%p %s %p %p %lx) - not tested\n", hInst, debugstr_w(name), owner, dlgProc, param); + + hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG ); + if ( !hrsrc ) + return NULL; + hgl = LoadResource (hInst, hrsrc); + if ( !hgl ) + return NULL; + ptr = (LPCDLGTEMPLATEW)LockResource ( hgl ); + if (!ptr) + { + FreeResource( hgl ); + return NULL; + } + newptr = AX_ConvertDialogTemplate( ptr ); + if ( newptr ) + { + res = CreateDialogIndirectParamW( hInst, newptr, owner, dlgProc, param ); + HeapFree( GetProcessHeap(), 0, newptr ); + } else + res = NULL; + FreeResource ( hrsrc ); + return res; +} diff --git a/dlls/atl/atliface.idl b/dlls/atl/atliface.idl index 884d187..bb5cb2e 100644 --- a/dlls/atl/atliface.idl +++ b/dlls/atl/atliface.idl @@ -73,3 +73,7 @@ cpp_quote("DEFINE_GUID(CLSID_ATLRegistra cpp_quote("HRESULT WINAPI AtlAxCreateControl(LPCOLESTR,HWND,IStream*,IUnknown**);") cpp_quote("HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR,HWND,IStream*,IUnknown**,IUnknown**,REFIID,IUnknown*);") cpp_quote("BOOL WINAPI AtlAxWinInit(void);") + +cpp_quote("HWND WINAPI AtlAxCreateDialogW(HINSTANCE,LPCWSTR,HWND,DLGPROC,LPARAM);"); +cpp_quote("HWND WINAPI AtlAxCreateDialogA(HINSTANCE,LPCSTR,HWND,DLGPROC,LPARAM);"); +cpp_quote("#define AtlAxCreateDialog WINELIB_NAME_AW(AtlAxCreateDialog");
1
0
0
0
Andrey Turkin : atl: Implement AtlAxCreateControl and AtlAxCreateControlEx.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 821aae4f9f182b79532d4fe16974acef0aed4649 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=821aae4f9f182b79532d4fe16…
Author: Andrey Turkin <pancha(a)mail.nnov.ru> Date: Mon Oct 30 21:20:26 2006 +0300 atl: Implement AtlAxCreateControl and AtlAxCreateControlEx. --- dlls/atl/Makefile.in | 2 +- dlls/atl/atl.spec | 2 +- dlls/atl/atl_ax.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++++- dlls/atl/atl_main.c | 10 ---- dlls/atl/atlbase.h | 2 + dlls/atl/atliface.idl | 1 + 6 files changed, 130 insertions(+), 13 deletions(-) diff --git a/dlls/atl/Makefile.in b/dlls/atl/Makefile.in index 24a8d88..4331990 100644 --- a/dlls/atl/Makefile.in +++ b/dlls/atl/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = atl.dll IMPORTLIB = libatl.$(IMPLIBEXT) -IMPORTS = ole32 shlwapi user32 gdi32 advapi32 kernel32 +IMPORTS = ole32 oleaut32 shlwapi user32 gdi32 advapi32 kernel32 EXTRALIBS = -luuid C_SRCS = \ diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec index a91cc84..db9ca9a 100644 --- a/dlls/atl/atl.spec +++ b/dlls/atl/atl.spec @@ -31,7 +31,7 @@ 37 stub AtlAxCreateDialogW 38 stub AtlAxCreateDialogA 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) -40 stub AtlAxCreateControlEx +40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) 41 stub AtlAxAttachControl 42 stdcall AtlAxWinInit() 43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr) diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c index 660e001..1170cb8 100644 --- a/dlls/atl/atl_ax.c +++ b/dlls/atl/atl_ax.c @@ -53,7 +53,7 @@ LRESULT static CALLBACK AtlAxWin_wndproc if (!ptr) return 1; GetWindowTextW( hWnd, ptr, len ); - AtlAxCreateControl( ptr, hWnd, NULL, NULL ); + AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL ); HeapFree( GetProcessHeap(), 0, ptr ); return 0; } @@ -97,3 +97,127 @@ BOOL WINAPI AtlAxWinInit(void) return TRUE; } + +/*********************************************************************** + * AtlAxCreateControl [ATL.@] + */ +HRESULT WINAPI AtlAxCreateControl(LPCOLESTR lpszName, HWND hWnd, + IStream *pStream, IUnknown **ppUnkContainer) +{ + return AtlAxCreateControlEx( lpszName, hWnd, pStream, ppUnkContainer, + NULL, NULL, NULL ); +} + +/*********************************************************************** + * AtlAxCreateControlEx [ATL.@] + * + * REMARKS + * See
http://www.codeproject.com/com/cwebpage.asp
for some background + * + */ +HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd, + IStream *pStream, IUnknown **ppUnkContainer, IUnknown **ppUnkControl, + REFIID iidSink, IUnknown *punkSink) +{ + CLSID controlId; + HRESULT hRes; + IOleObject *pControl; + IUnknown *pUnkControl; + IPersistStreamInit *pPSInit; + IUnknown *pContainer; + enum {IsGUID=0,IsHTML=1,IsURL=2} content; + + TRACE("(%s %p %p %p %p %p %p)\n", debugstr_w(lpszName), hWnd, pStream, + ppUnkContainer, ppUnkControl, iidSink, punkSink); + + hRes = CLSIDFromString( (LPOLESTR) lpszName, &controlId ); + if ( FAILED(hRes) ) + hRes = CLSIDFromProgID( lpszName, &controlId ); + if ( SUCCEEDED( hRes ) ) + content = IsGUID; + else { + /* FIXME - check for MSHTML: prefix! */ + content = IsURL; + memcpy( &controlId, &CLSID_WebBrowser, sizeof(controlId) ); + } + + hRes = CoCreateInstance( &controlId, 0, CLSCTX_ALL, &IID_IOleObject, + (void**) &pControl ); + if ( FAILED( hRes ) ) + { + WARN( "cannot create ActiveX control %s instance - error 0x%08x\n", + debugstr_guid( &controlId ), hRes ); + return hRes; + } + + hRes = IOleObject_QueryInterface( pControl, &IID_IPersistStreamInit, (void**) &pPSInit ); + if ( SUCCEEDED( hRes ) ) + { + if (!pStream) + IPersistStreamInit_InitNew( pPSInit ); + else + IPersistStreamInit_Load( pPSInit, pStream ); + IPersistStreamInit_Release( pPSInit ); + } else + WARN("cannot get IID_IPersistStreamInit out of control\n"); + + IOleObject_QueryInterface( pControl, &IID_IUnknown, (void**) &pUnkControl ); + IOleObject_Release( pControl ); + + + hRes = AtlAxAttachControl( pUnkControl, hWnd, &pContainer ); + if ( FAILED( hRes ) ) + WARN("cannot attach control to window\n"); + + if ( content == IsURL ) + { + IWebBrowser2 *browser; + + hRes = IOleObject_QueryInterface( pControl, &IID_IWebBrowser2, (void**) &browser ); + if ( !browser ) + WARN( "Cannot query IWebBrowser2 interface: %08x\n", hRes ); + else { + VARIANT url; + + IWebBrowser2_put_Visible( browser, VARIANT_TRUE ); /* it seems that native does this on URL (but do not on MSHTML:! why? */ + + V_VT(&url) = VT_BSTR; + V_BSTR(&url) = SysAllocString( lpszName ); + + hRes = IWebBrowser2_Navigate2( browser, &url, NULL, NULL, NULL, NULL ); + if ( FAILED( hRes ) ) + WARN( "IWebBrowser2::Navigate2 failed: %08x\n", hRes ); + SysFreeString( V_BSTR(&url) ); + + IWebBrowser2_Release( browser ); + } + } + + if (ppUnkContainer) + { + *ppUnkContainer = pContainer; + if ( pContainer ) + IUnknown_AddRef( pContainer ); + } + if (ppUnkControl) + { + *ppUnkControl = pUnkControl; + if ( pUnkControl ) + IUnknown_AddRef( pUnkControl ); + } + + IUnknown_Release( pUnkControl ); + if ( pContainer ) + IUnknown_Release( pContainer ); + + return S_OK; +} + +/*********************************************************************** + * AtlAxAttachControl [ATL.@] + */ +HRESULT WINAPI AtlAxAttachControl(IUnknown* pControl, HWND hWnd, IUnknown** ppUnkContainer) +{ + FIXME( "(%p %p %p) - stub\n", pControl, hWnd, ppUnkContainer ); + return E_NOTIMPL; +} diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 0d2c67e..547a5cf 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -347,16 +347,6 @@ HRESULT WINAPI AtlModuleUnregisterServer } /*********************************************************************** - * AtlAxCreateControl [ATL.@] - */ -HRESULT WINAPI AtlAxCreateControl(LPCOLESTR lpszName, HWND hWnd, - IStream *pStream, IUnknown **ppUnkContainer) -{ - FIXME("%s %p %p %p)\n", debugstr_w(lpszName), hWnd, pStream, ppUnkContainer); - return E_NOTIMPL; -} - -/*********************************************************************** * AtlModuleRegisterWndClassInfoW [ATL.@] * * PARAMS diff --git a/dlls/atl/atlbase.h b/dlls/atl/atlbase.h index 218db5e..c0a556f 100644 --- a/dlls/atl/atlbase.h +++ b/dlls/atl/atlbase.h @@ -142,7 +142,9 @@ struct _ATL_REGMAP_ENTRY }; HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID * iid, LPDWORD dpw); +HRESULT WINAPI AtlAxAttachControl(IUnknown*,HWND,IUnknown**); HRESULT WINAPI AtlAxCreateControl(LPCOLESTR,HWND,IStream*,IUnknown**); +HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR,HWND,IStream*,IUnknown**,IUnknown**,REFIID,IUnknown*); HRESULT WINAPI AtlFreeMarshalStream(IStream *pStream); HRESULT WINAPI AtlInternalQueryInterface(LPVOID pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, LPVOID* ppvObject); HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **ppStream); diff --git a/dlls/atl/atliface.idl b/dlls/atl/atliface.idl index af01ee0..884d187 100644 --- a/dlls/atl/atliface.idl +++ b/dlls/atl/atliface.idl @@ -71,4 +71,5 @@ interface IRegistrar : IUnknown cpp_quote("DEFINE_GUID(CLSID_ATLRegistrar,0x44ec053a,0x400f,0x11d0,0x9d,0xcd,0x00,0xa0,0xc9,0x03,0x91,0xd3);") cpp_quote("HRESULT WINAPI AtlAxCreateControl(LPCOLESTR,HWND,IStream*,IUnknown**);") +cpp_quote("HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR,HWND,IStream*,IUnknown**,IUnknown**,REFIID,IUnknown*);") cpp_quote("BOOL WINAPI AtlAxWinInit(void);")
1
0
0
0
Andrey Turkin : atl: Implement AtlModuleAddCreateWndData and AtlModuleExtractCreateWndData.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: b7ec4de7c6656f87e0a48e17b4fa38915ab62bb1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7ec4de7c6656f87e0a48e17b…
Author: Andrey Turkin <pancha(a)mail.nnov.ru> Date: Mon Oct 30 18:55:05 2006 +0300 atl: Implement AtlModuleAddCreateWndData and AtlModuleExtractCreateWndData. --- dlls/atl/atl.spec | 4 ++-- dlls/atl/atl_main.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/atl/atlbase.h | 2 ++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec index c8f0199..a91cc84 100644 --- a/dlls/atl/atl.spec +++ b/dlls/atl/atl.spec @@ -34,8 +34,8 @@ 40 stub AtlAxCreateControlEx 41 stub AtlAxAttachControl 42 stdcall AtlAxWinInit() -43 stub AtlModuleAddCreateWndData -44 stub AtlModuleExtractCreateWndData +43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr) +44 stdcall AtlModuleExtractCreateWndData(ptr) 45 stdcall AtlModuleRegisterWndClassInfoW(ptr ptr ptr) 46 stub AtlModuleRegisterWndClassInfoA 47 stub AtlAxGetControl diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 6c72289..0d2c67e 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -423,3 +423,42 @@ void WINAPI AtlPixelToHiMetric(const SIZ lpHiMetric->cy = 100 * lpPix->cy / GetDeviceCaps( dc, LOGPIXELSY ); ReleaseDC( NULL, dc ); } + +/*********************************************************************** + * AtlModuleAddCreateWndData [ATL.@] + */ +void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData, LPVOID pvObject) +{ + TRACE("(%p, %p, %p)\n", pM, pData, pvObject); + + pData->m_pThis = pvObject; + pData->m_dwThreadID = GetCurrentThreadId(); + pData->m_pNext = pM->m_pCreateWndList; + pM->m_pCreateWndList = pData; +} + +/*********************************************************************** + * AtlModuleExtractCreateWndData [ATL.@] + * + * NOTE: I failed to find any good description of this function. + * Tests show that this function extracts one of _AtlCreateWndData + * records from the current thread from a list + * + */ +LPVOID WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM) +{ + _AtlCreateWndData **ppData; + + TRACE("(%p)\n", pM); + + for(ppData = &pM->m_pCreateWndList; *ppData!=NULL; ppData = &(*ppData)->m_pNext) + { + if ((*ppData)->m_dwThreadID == GetCurrentThreadId()) + { + _AtlCreateWndData *pData = *ppData; + *ppData = pData->m_pNext; + return pData->m_pThis; + } + } + return NULL; +} diff --git a/dlls/atl/atlbase.h b/dlls/atl/atlbase.h index 9be245f..218db5e 100644 --- a/dlls/atl/atlbase.h +++ b/dlls/atl/atlbase.h @@ -146,7 +146,9 @@ HRESULT WINAPI AtlAxCreateControl(LPCOLE HRESULT WINAPI AtlFreeMarshalStream(IStream *pStream); HRESULT WINAPI AtlInternalQueryInterface(LPVOID pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, LPVOID* ppvObject); HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **ppStream); +void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData, LPVOID pvObject); HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULEW *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw); +LPVOID WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM); HRESULT WINAPI AtlModuleInit(_ATL_MODULEA* pM, _ATL_OBJMAP_ENTRYA* p, HINSTANCE h); HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEA* pM, DWORD dwClsContext, DWORD dwFlags); HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* pCLSID);
1
0
0
0
Andrey Turkin : atl: Implement AtlAxWinInit and AtlAxWin window procedure.
by Alexandre Julliard
02 Nov '06
02 Nov '06
Module: wine Branch: master Commit: 2d9fc5d7b595541e318965825fb2dbfc7888c78c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2d9fc5d7b595541e318965825…
Author: Andrey Turkin <pancha(a)mail.nnov.ru> Date: Mon Oct 30 19:07:46 2006 +0300 atl: Implement AtlAxWinInit and AtlAxWin window procedure. --- dlls/atl/Makefile.in | 1 + dlls/atl/atl_ax.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/atl/atl_main.c | 15 -------- 3 files changed, 100 insertions(+), 15 deletions(-) diff --git a/dlls/atl/Makefile.in b/dlls/atl/Makefile.in index fc20950..24a8d88 100644 --- a/dlls/atl/Makefile.in +++ b/dlls/atl/Makefile.in @@ -8,6 +8,7 @@ IMPORTS = ole32 shlwapi user32 gdi32 a EXTRALIBS = -luuid C_SRCS = \ + atl_ax.c \ atl_main.c \ registrar.c diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c new file mode 100644 index 0000000..660e001 --- /dev/null +++ b/dlls/atl/atl_ax.c @@ -0,0 +1,99 @@ +/* + * Active Template Library ActiveX functions (atl.dll) + * + * Copyright 2006 Andrey Turkin + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdio.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winerror.h" +#include "winuser.h" +#include "wine/debug.h" +#include "objbase.h" +#include "objidl.h" +#include "ole2.h" +#include "exdisp.h" +#include "atlbase.h" +#include "atliface.h" +#include "atlwin.h" + +#include "wine/unicode.h" + +WINE_DEFAULT_DEBUG_CHANNEL(atl); + +/********************************************************************** + * AtlAxWin class window procedure + */ +LRESULT static CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam ) +{ + if ( wMsg == WM_CREATE ) + { + DWORD len = GetWindowTextLengthW( hWnd ) + 1; + WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + if (!ptr) + return 1; + GetWindowTextW( hWnd, ptr, len ); + AtlAxCreateControl( ptr, hWnd, NULL, NULL ); + HeapFree( GetProcessHeap(), 0, ptr ); + return 0; + } + return DefWindowProcW( hWnd, wMsg, wParam, lParam ); +} + +/*********************************************************************** + * AtlAxWinInit [ATL.@] + * Initializes the control-hosting code: registering the AtlAxWin, + * AtlAxWin7 and AtlAxWinLic7 window classes and some messages. + * + * RETURNS + * TRUE or FALSE + */ + +BOOL WINAPI AtlAxWinInit(void) +{ + WNDCLASSEXW wcex; + const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n',0}; + + FIXME("semi-stub\n"); + + if ( FAILED( OleInitialize(NULL) ) ) + return FALSE; + + wcex.cbSize = sizeof(wcex); + wcex.style = 0; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = GetModuleHandleW( NULL ); + wcex.hIcon = NULL; + wcex.hCursor = NULL; + wcex.hbrBackground = NULL; + wcex.lpszMenuName = NULL; + wcex.hIconSm = 0; + + wcex.lpfnWndProc = AtlAxWin_wndproc; + wcex.lpszClassName = AtlAxWin; + if ( !RegisterClassExW( &wcex ) ) + return FALSE; + + return TRUE; +} diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index f7a6fc4..6c72289 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -180,21 +180,6 @@ HRESULT WINAPI AtlModuleUnregisterServer return S_OK; } -/*********************************************************************** - * AtlAxWinInit [ATL.@] - * Initializes the control-hosting code: registering the AtlAxWin7 and AtlAxWinLic7 window - * classes and some messages. - * - * RETURNS - * TRUE or FALSE - */ - -BOOL WINAPI AtlAxWinInit(void) -{ - FIXME("Try use native atl.dll if possible\n"); - return FALSE; -} - IUnknown* WINAPI AtlComPtrAssign(IUnknown** pp, IUnknown *p) {
1
0
0
0
← Newer
1
...
71
72
73
74
75
76
77
...
80
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
Results per page:
10
25
50
100
200