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
Dmitry Timoshkov : kernel32: Add basic OpenProcess test.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: ecdfa083646de05937f760bfe815ada5412364ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ecdfa083646de05937f760bfe…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Nov 8 23:45:33 2006 +0800 kernel32: Add basic OpenProcess test. --- dlls/kernel32/tests/process.c | 85 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 693e9b5..8b11e74 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2,6 +2,7 @@ * Unit test suite for CreateProcess function. * * Copyright 2002 Eric Pouech + * Copyright 2006 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1265,6 +1266,89 @@ static void test_ExitCode(void) assert(DeleteFileA(resfile) != 0); } +static void test_OpenProcess(void) +{ + HANDLE hproc; + void *addr1; + MEMORY_BASIC_INFORMATION info; + SIZE_T dummy, read_bytes; + + /* without PROCESS_VM_OPERATION */ + hproc = OpenProcess(PROCESS_ALL_ACCESS & ~PROCESS_VM_OPERATION, FALSE, GetCurrentProcessId()); + ok(hproc != NULL, "OpenProcess error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + addr1 = VirtualAllocEx(hproc, 0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); +todo_wine { + ok(!addr1, "VirtualAllocEx should fail\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); +} + + read_bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ok(ReadProcessMemory(hproc, test_OpenProcess, &dummy, sizeof(dummy), &read_bytes), + "ReadProcessMemory error %d\n", GetLastError()); + ok(read_bytes == sizeof(dummy), "wrong read bytes %ld\n", read_bytes); + + CloseHandle(hproc); + + hproc = OpenProcess(PROCESS_VM_OPERATION, FALSE, GetCurrentProcessId()); + ok(hproc != NULL, "OpenProcess error %d\n", GetLastError()); + + addr1 = VirtualAllocEx(hproc, 0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); +todo_wine { + ok(addr1 != NULL, "VirtualAllocEx error %d\n", GetLastError()); +} + if (addr1 == NULL) /* FIXME: remove once Wine is fixed */ + addr1 = VirtualAllocEx(GetCurrentProcess(), 0, 0xFFFC, MEM_RESERVE, PAGE_NOACCESS); + + /* without PROCESS_QUERY_INFORMATION */ + SetLastError(0xdeadbeef); + ok(!VirtualQueryEx(hproc, addr1, &info, sizeof(info)), + "VirtualQueryEx without PROCESS_QUERY_INFORMATION rights should fail\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + + /* without PROCESS_VM_READ */ + read_bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ok(!ReadProcessMemory(hproc, addr1, &dummy, sizeof(dummy), &read_bytes), + "ReadProcessMemory without PROCESS_VM_READ rights should fail\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); + ok(read_bytes == 0, "wrong read bytes %ld\n", read_bytes); + + CloseHandle(hproc); + + hproc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, GetCurrentProcessId()); + + memset(&info, 0xaa, sizeof(info)); + ok(VirtualQueryEx(hproc, addr1, &info, sizeof(info)) == sizeof(info), + "VirtualQueryEx error %d\n", GetLastError()); + + ok(info.BaseAddress == addr1, "%p != %p\n", info.BaseAddress, addr1); + ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); + ok(info.AllocationProtect == PAGE_NOACCESS, "%x != PAGE_NOACCESS\n", info.AllocationProtect); + ok(info.RegionSize == 0x10000, "%lx != 0x10000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); + /* NT reports Protect == 0 for a not committed memory block */ + ok(info.Protect == 0 /* NT */ || + info.Protect == PAGE_NOACCESS, /* Win9x */ + "%x != PAGE_NOACCESS\n", info.Protect); + ok(info.Type == MEM_PRIVATE, "%x != MEM_PRIVATE\n", info.Type); + + SetLastError(0xdeadbeef); +todo_wine { + ok(!VirtualFreeEx(hproc, addr1, 0, MEM_RELEASE), + "VirtualFreeEx without PROCESS_VM_OPERATION rights should fail\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %d\n", GetLastError()); +} + + CloseHandle(hproc); + +todo_wine { + ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n"); +} +} + START_TEST(process) { int b = init(); @@ -1284,6 +1368,7 @@ START_TEST(process) test_DebuggingFlag(); test_Console(); test_ExitCode(); + test_OpenProcess(); /* things that can be tested: * lookup: check the way program to be executed is searched * handles: check the handle inheritance stuff (+sec options)
1
0
0
0
Dmitry Timoshkov : include: Add the PROCESS_SUSPEND_RESUME definition.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: 8120dea049d49514c6b07be7c8ee93a62b405db2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8120dea049d49514c6b07be7c…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Nov 8 23:46:37 2006 +0800 include: Add the PROCESS_SUSPEND_RESUME definition. --- include/winnt.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index 913c034..fb760af 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -3826,6 +3826,7 @@ #define PROCESS_CREATE_PROCESS 0x008 #define PROCESS_SET_QUOTA 0x0100 #define PROCESS_SET_INFORMATION 0x0200 #define PROCESS_QUERY_INFORMATION 0x0400 +#define PROCESS_SUSPEND_RESUME 0x0800 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff) #define THREAD_TERMINATE 0x0001
1
0
0
0
Paul Vriens : comctl32: Load function pointers by ordinal.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: 6e9f335656543ef1d8c9a7881b3f02a2351c66b0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e9f335656543ef1d8c9a7881…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Wed Nov 8 12:39:35 2006 +0100 comctl32: Load function pointers by ordinal. --- dlls/comctl32/tests/subclass.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index 9455fbd..fc451ee 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -285,9 +285,12 @@ START_TEST(subclass) hdll = GetModuleHandleA("comctl32.dll"); assert(hdll); - pSetWindowSubclass = (void*)GetProcAddress(hdll, "SetWindowSubclass"); - pRemoveWindowSubclass = (void*)GetProcAddress(hdll, "RemoveWindowSubclass"); - pDefSubclassProc = (void*)GetProcAddress(hdll, "DefSubclassProc"); + /* Functions have to be loaded by ordinal. Only XP and W2K3 export + * them by name. + */ + pSetWindowSubclass = (void*)GetProcAddress(hdll, (LPSTR)410); + pRemoveWindowSubclass = (void*)GetProcAddress(hdll, (LPSTR)412); + pDefSubclassProc = (void*)GetProcAddress(hdll, (LPSTR)413); if(!pSetWindowSubclass || !pRemoveWindowSubclass || !pDefSubclassProc) return;
1
0
0
0
Kai Blin : secur32: Use a helper function for creating the signature as this simplifies implementing NTLM2 signing a lot .
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: a51e02c5d683d22894c17c171c8ed939d3d73323 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a51e02c5d683d22894c17c171…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Wed Nov 8 12:10:37 2006 +0100 secur32: Use a helper function for creating the signature as this simplifies implementing NTLM2 signing a lot. --- dlls/secur32/ntlm.c | 202 +++++++++++++++++++----------------------- dlls/secur32/secur32_priv.h | 5 + 2 files changed, 96 insertions(+), 111 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a51e02c5d683d22894c17…
1
0
0
0
Kai Blin : secur32: Delete session key and arc4 context when the session based security context is deleted .
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: 6720a129f3a77a280e589660828855a06ccdd5e0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6720a129f3a77a280e5896608…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Wed Nov 8 12:10:05 2006 +0100 secur32: Delete session key and arc4 context when the session based security context is deleted. --- dlls/secur32/dispatcher.c | 1 - dlls/secur32/ntlm.c | 32 ++++++++++++++++---------------- dlls/secur32/secur32_priv.h | 1 + 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/secur32/dispatcher.c b/dlls/secur32/dispatcher.c index b7b9f9d..c150a14 100644 --- a/dlls/secur32/dispatcher.c +++ b/dlls/secur32/dispatcher.c @@ -258,7 +258,6 @@ void cleanup_helper(PNegoHelper helper) return; HeapFree(GetProcessHeap(), 0, helper->com_buf); - HeapFree(GetProcessHeap(), 0, helper->session_key); /* closing stdin will terminate ntlm_auth */ close(helper->pipe_out); diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 8cc206d..2b3c02d 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -690,8 +690,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_In } TRACE("Session key is %s\n", debugstr_a(buffer+3)); helper->valid_session_key = TRUE; - if(!helper->session_key) - helper->session_key = HeapAlloc(GetProcessHeap(), 0, bin_len); + helper->session_key = HeapAlloc(GetProcessHeap(), 0, bin_len); if(!helper->session_key) { TRACE("Failed to allocate memory for session key\n"); @@ -1036,8 +1035,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac } TRACE("Session key is %s\n", debugstr_a(buffer+3)); helper->valid_session_key = TRUE; - if(!helper->session_key) - helper->session_key = HeapAlloc(GetProcessHeap(), 0, 16); + helper->session_key = HeapAlloc(GetProcessHeap(), 0, 16); if(!helper->session_key) { TRACE("Failed to allocate memory for session key\n"); @@ -1081,20 +1079,22 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Co */ static SECURITY_STATUS SEC_ENTRY ntlm_DeleteSecurityContext(PCtxtHandle phContext) { - SECURITY_STATUS ret; + PNegoHelper helper; TRACE("%p\n", phContext); - if (phContext) - { - phContext->dwUpper = 0; - phContext->dwLower = 0; - ret = SEC_E_OK; - } - else - { - ret = SEC_E_INVALID_HANDLE; - } - return ret; + if (!phContext) + return SEC_E_INVALID_HANDLE; + + helper = (PNegoHelper)phContext->dwLower; + + phContext->dwUpper = 0; + phContext->dwLower = 0; + + SECUR32_arc4Cleanup(helper->crypt.ntlm.a4i); + HeapFree(GetProcessHeap(), 0, helper->session_key); + helper->valid_session_key = FALSE; + + return SEC_E_OK; } /*********************************************************************** diff --git a/dlls/secur32/secur32_priv.h b/dlls/secur32/secur32_priv.h index d2002fd..8a6a290 100644 --- a/dlls/secur32/secur32_priv.h +++ b/dlls/secur32/secur32_priv.h @@ -139,6 +139,7 @@ SECURITY_STATUS SECUR32_CreateNTLMv1Sess arc4_info *SECUR32_arc4Alloc(void); void SECUR32_arc4Init(arc4_info *a4i, const BYTE *key, unsigned int keyLen); void SECUR32_arc4Process(arc4_info *a4i, BYTE *inoutString, unsigned int length); +void SECUR32_arc4Cleanup(arc4_info *a4i); /* NTLMSSP flags indicating the negotiated features */ #define NTLMSSP_NEGOTIATE_UNICODE 0x00000001
1
0
0
0
Ken Thomases : winex11.drv: Fix off-by-one in map of non-char keysyms to vkeys.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: d88d2d4d13d3b0d62c71b6c035979edbc3b819ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d88d2d4d13d3b0d62c71b6c03…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Nov 8 04:09:58 2006 -0600 winex11.drv: Fix off-by-one in map of non-char keysyms to vkeys. --- dlls/winex11.drv/keyboard.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index d44f16c..fbc64d7 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1002,7 +1002,7 @@ static const WORD nonchar_key_vkey[256] 0, 0, 0, 0, 0, 0, 0, 0, /* FF58 */ /* misc keys */ VK_SELECT, VK_SNAPSHOT, VK_EXECUTE, VK_INSERT, 0, 0, 0, 0, /* FF60 */ - VK_CANCEL, VK_HELP, VK_CANCEL, VK_CANCEL, 0, 0, 0, 0, /* FF68 */ + 0, VK_CANCEL, VK_HELP, VK_CANCEL, 0, 0, 0, 0, /* FF68 */ 0, 0, 0, 0, 0, 0, 0, 0, /* FF70 */ /* keypad keys */ 0, 0, 0, 0, 0, 0, 0, VK_NUMLOCK, /* FF78 */
1
0
0
0
Ken Thomases : winex11.drv: Map XK_KP_Equal to VK_OEM_NEC_EQUAL.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: 75195ad4bcfb6e765c2e6a45fa23d28d4d76d860 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=75195ad4bcfb6e765c2e6a45f…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Nov 8 04:08:29 2006 -0600 winex11.drv: Map XK_KP_Equal to VK_OEM_NEC_EQUAL. --- dlls/winex11.drv/keyboard.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index f4fc7fa..d44f16c 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1016,7 +1016,7 @@ static const WORD nonchar_key_vkey[256] VK_SEPARATOR, VK_SUBTRACT, VK_DECIMAL, VK_DIVIDE, VK_NUMPAD0, VK_NUMPAD1, VK_NUMPAD2, VK_NUMPAD3, /* FFB0 */ VK_NUMPAD4, VK_NUMPAD5, VK_NUMPAD6, VK_NUMPAD7, - VK_NUMPAD8, VK_NUMPAD9, 0, 0, 0, 0, /* FFB8 */ + VK_NUMPAD8, VK_NUMPAD9, 0, 0, 0, VK_OEM_NEC_EQUAL, /* FFB8 */ /* function keys */ VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* FFC0 */
1
0
0
0
Alexandre Julliard : winex11.drv: Get rid of the DIB color table now that it's stored in gdi32.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: 3cb51cd3c43db22b888a2ef7b0b4da4dd5af575e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3cb51cd3c43db22b888a2ef7b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 8 19:57:37 2006 +0100 winex11.drv: Get rid of the DIB color table now that it's stored in gdi32. --- dlls/winex11.drv/dib.c | 118 +++--------------------------------- dlls/winex11.drv/palette.c | 13 ++-- dlls/winex11.drv/winex11.drv.spec | 1 - dlls/winex11.drv/x11drv.h | 2 - 4 files changed, 17 insertions(+), 117 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3cb51cd3c43db22b888a2…
1
0
0
0
Alexandre Julliard : gdi32: Remove call to CreateCompatibleDC() from GetDIBits() implementation.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: f7ffbe4581ee4f358b6f39a1376573cd27286eaa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f7ffbe4581ee4f358b6f39a13…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 8 19:57:30 2006 +0100 gdi32: Remove call to CreateCompatibleDC() from GetDIBits() implementation. Based on a patch by Alex Villacís Lasso. --- dlls/gdi32/bitmap.c | 3 + dlls/gdi32/dib.c | 142 ++++++++++++++++++++++++++++++++++++--------- dlls/gdi32/gdi_private.h | 2 + dlls/gdi32/tests/bitmap.c | 5 +- 4 files changed, 120 insertions(+), 32 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index 1a638c7..d720ae4 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -279,6 +279,8 @@ HBITMAP WINAPI CreateBitmapIndirect( con bmpobj->funcs = NULL; bmpobj->dib = NULL; bmpobj->segptr_bits = 0; + bmpobj->color_table = NULL; + bmpobj->nb_colors = 0; if (bm.bmBits) SetBitmapBits( hbitmap, bm.bmHeight * bm.bmWidthBytes, bm.bmBits ); @@ -628,6 +630,7 @@ static BOOL BITMAP_DeleteObject( HGDIOBJ for (i = 0; i < count; i++) FreeSelector16(sel + (i << __AHSHIFT)); } + HeapFree(GetProcessHeap(), 0, bmp->color_table); } return GDI_FreeObject( handle, obj ); } diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 07bd8ed..a3d559c 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -387,11 +387,27 @@ UINT WINAPI SetDIBColorTable( HDC hdc, U { DC * dc; UINT result = 0; + BITMAPOBJ * bitmap; - if (!(dc = DC_GetDCUpdate( hdc ))) return 0; + if (!(dc = DC_GetDCPtr( hdc ))) return 0; + + if ((bitmap = GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC ))) + { + /* Check if currently selected bitmap is a DIB */ + if (bitmap->color_table) + { + if (startpos < bitmap->nb_colors) + { + if (startpos + entries > bitmap->nb_colors) entries = bitmap->nb_colors - startpos; + memcpy(bitmap->color_table + startpos, colors, entries * sizeof(RGBQUAD)); + result = entries; + } + } + GDI_ReleaseObj( dc->hBitmap ); + } if (dc->funcs->pSetDIBColorTable) - result = dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors); + dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors); GDI_ReleaseObj( hdc ); return result; @@ -406,11 +422,28 @@ UINT WINAPI GetDIBColorTable( HDC hdc, U DC * dc; UINT result = 0; - if (!(dc = DC_GetDCUpdate( hdc ))) return 0; + if (!(dc = DC_GetDCPtr( hdc ))) return 0; if (dc->funcs->pGetDIBColorTable) result = dc->funcs->pGetDIBColorTable(dc->physDev, startpos, entries, colors); - + else + { + BITMAPOBJ *bitmap = GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC ); + if (bitmap) + { + /* Check if currently selected bitmap is a DIB */ + if (bitmap->color_table) + { + if (startpos < bitmap->nb_colors) + { + if (startpos + entries > bitmap->nb_colors) entries = bitmap->nb_colors - startpos; + memcpy(colors, bitmap->color_table + startpos, entries * sizeof(RGBQUAD)); + result = entries; + } + } + GDI_ReleaseObj( dc->hBitmap ); + } + } GDI_ReleaseObj( hdc ); return result; } @@ -533,7 +566,6 @@ INT WINAPI GetDIBits( DC * dc; BITMAPOBJ * bmp; int i; - HDC memdc; int bitmap_type; BOOL core_header; LONG width; @@ -553,16 +585,13 @@ INT WINAPI GetDIBits( return 0; } core_header = (bitmap_type == 0); - memdc = CreateCompatibleDC(hdc); if (!(dc = DC_GetDCUpdate( hdc ))) { - DeleteDC(memdc); return 0; } if (!(bmp = (BITMAPOBJ *)GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) { GDI_ReleaseObj( hdc ); - DeleteDC(memdc); return 0; } @@ -580,34 +609,25 @@ INT WINAPI GetDIBits( same color depth then get the color map from it */ if (bmp->dib && bmp->dib->dsBm.bmBitsPixel == bpp) { if(coloruse == DIB_RGB_COLORS) { - HBITMAP oldbm = SelectObject(memdc, hbitmap); - unsigned int colors = 1 << bpp; + unsigned int colors = min( bmp->nb_colors, 1 << bpp ); if (core_header) { - /* Convert the color table (RGBQUAD to RGBTRIPLE) */ - RGBQUAD* buffer = HeapAlloc(GetProcessHeap(), 0, colors * sizeof(RGBQUAD)); + /* Convert the color table (RGBQUAD to RGBTRIPLE) */ + RGBTRIPLE* index = rgbTriples; - if (buffer) + for (i=0; i < colors; i++, index++) { - RGBTRIPLE* index = rgbTriples; - GetDIBColorTable(memdc, 0, colors, buffer); - - for (i=0; i < colors; i++, index++) - { - index->rgbtRed = buffer[i].rgbRed; - index->rgbtGreen = buffer[i].rgbGreen; - index->rgbtBlue = buffer[i].rgbBlue; - } - - HeapFree(GetProcessHeap(), 0, buffer); + index->rgbtRed = bmp->color_table[i].rgbRed; + index->rgbtGreen = bmp->color_table[i].rgbGreen; + index->rgbtBlue = bmp->color_table[i].rgbBlue; } } else { - GetDIBColorTable(memdc, 0, colors, colorPtr); + if (colors != 1 << bpp) info->bmiHeader.biClrUsed = colors; + memcpy(colorPtr, bmp->color_table, colors * sizeof(RGBQUAD)); } - SelectObject(memdc, oldbm); } else { WORD *index = colorPtr; @@ -623,7 +643,6 @@ INT WINAPI GetDIBits( if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC ))) { GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hbitmap ); - DeleteDC(memdc); return 0; } palEntry = palette->logpalette.palPalEntry; @@ -1019,7 +1038,6 @@ INT WINAPI GetDIBits( GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hbitmap ); - DeleteDC(memdc); return lines; } @@ -1126,6 +1144,72 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC return HBITMAP_16(hbitmap); } +/* Copy/synthetize RGB palette from BITMAPINFO. Ripped from dlls/winex11.drv/dib.c */ +static void DIB_CopyColorTable( DC *dc, BITMAPOBJ *bmp, WORD coloruse, const BITMAPINFO *info ) +{ + RGBQUAD *colorTable; + unsigned int colors; + int i; + BOOL core_info = info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER); + + if (core_info) + { + colors = 1 << ((const BITMAPCOREINFO*) info)->bmciHeader.bcBitCount; + } + else + { + colors = info->bmiHeader.biClrUsed; + if (!colors) colors = 1 << info->bmiHeader.biBitCount; + } + + if (colors > 256) { + ERR("called with >256 colors!\n"); + return; + } + + if (!(colorTable = HeapAlloc(GetProcessHeap(), 0, colors * sizeof(RGBQUAD) ))) return; + + if(coloruse == DIB_RGB_COLORS) + { + if (core_info) + { + /* Convert RGBTRIPLEs to RGBQUADs */ + for (i=0; i < colors; i++) + { + colorTable[i].rgbRed = ((const BITMAPCOREINFO*) info)->bmciColors[i].rgbtRed; + colorTable[i].rgbGreen = ((const BITMAPCOREINFO*) info)->bmciColors[i].rgbtGreen; + colorTable[i].rgbBlue = ((const BITMAPCOREINFO*) info)->bmciColors[i].rgbtBlue; + colorTable[i].rgbReserved = 0; + } + } + else + { + memcpy(colorTable, (const BYTE*) info + (WORD) info->bmiHeader.biSize, colors * sizeof(RGBQUAD)); + } + } + else + { + PALETTEOBJ *palette; + const WORD *index = (const WORD*) ((const BYTE*) info + (WORD) info->bmiHeader.biSize); + + if ((palette = GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC ))) + { + UINT entries = palette->logpalette.palNumEntries; + for (i = 0; i < colors; i++, index++) + { + PALETTEENTRY *entry = &palette->logpalette.palPalEntry[*index % entries]; + colorTable[i].rgbRed = entry->peRed; + colorTable[i].rgbGreen = entry->peGreen; + colorTable[i].rgbBlue = entry->peBlue; + colorTable[i].rgbReserved = 0; + } + GDI_ReleaseObj( dc->hPalette ); + } + } + bmp->color_table = colorTable; + bmp->nb_colors = colors; +} + /*********************************************************************** * CreateDIBSection (GDI32.@) */ @@ -1260,6 +1344,8 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, { bmp->dib = dib; bmp->funcs = dc->funcs; + /* create local copy of DIB palette */ + if (bpp <= 8) DIB_CopyColorTable( dc, bmp, usage, bmi ); GDI_ReleaseObj( ret ); if (dc->funcs->pCreateDIBSection) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 1dbae75..0d3f1d0 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -324,6 +324,8 @@ typedef struct tagBITMAPOBJ /* For device-independent bitmaps: */ DIBSECTION *dib; SEGPTR segptr_bits; /* segptr to DIB bits */ + RGBQUAD *color_table; /* DIB color table if <= 8bpp */ + UINT nb_colors; /* number of colors in table */ } BITMAPOBJ; /* bidi.c */ diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 8503e08..9701a00 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1096,10 +1096,7 @@ static void test_GetDIBits_selected_DIB( break; } } - todo_wine - { - ok(equalContents, "GetDIBits with DIB selected in DC: Invalid DIB color table\n"); - } + ok(equalContents, "GetDIBits with DIB selected in DC: Invalid DIB color table\n"); equalContents = TRUE; for (i=0; i < dib_size / sizeof(DWORD); i++)
1
0
0
0
Alex Villacís Lasso : oleaut32: varformat - Force LCID_US for conversion in VarFormatNumber.
by Alexandre Julliard
08 Nov '06
08 Nov '06
Module: wine Branch: master Commit: 68817c10eec0de98be00e043322ab9857b40818a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=68817c10eec0de98be00e0433…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Mon Nov 6 17:04:16 2006 -0500 oleaut32: varformat - Force LCID_US for conversion in VarFormatNumber. --- dlls/oleaut32/varformat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c index f8ccfd3..095cc6c 100644 --- a/dlls/oleaut32/varformat.c +++ b/dlls/oleaut32/varformat.c @@ -2199,7 +2199,7 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT hRet = VariantCopyInd(&vStr, pVarIn); if (SUCCEEDED(hRet)) - hRet = VariantChangeTypeEx(&vStr, &vStr, LOCALE_USER_DEFAULT, 0, VT_BSTR); + hRet = VariantChangeTypeEx(&vStr, &vStr, LCID_US, 0, VT_BSTR); if (SUCCEEDED(hRet)) {
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
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