ReactOS.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
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
List overview
Download
Ros-diffs
May 2012
----- 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
ros-diffs@reactos.org
12 participants
227 discussions
Start a n
N
ew thread
[akhaldi] 56611: [FUSION] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 09:41:07 2012 New Revision: 56611 URL:
http://svn.reactos.org/svn/reactos?rev=56611&view=rev
Log: [FUSION] * Sync to Wine 1.5.4. Modified: trunk/reactos/dll/win32/fusion/CMakeLists.txt trunk/reactos/dll/win32/fusion/asmcache.c trunk/reactos/dll/win32/fusion/asmname.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/fusion/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fusion/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/fusion/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fusion/CMakeLists.txt [iso-8859-1] Sat May 19 09:41:07 2012 @@ -1,9 +1,6 @@ add_definitions(-D__WINESRC__) - include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) - -set_rc_compiler() spec2def(fusion.dll fusion.spec) @@ -19,11 +16,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/fusion.def) add_library(fusion SHARED ${SOURCE}) - set_module_type(fusion win32dll) target_link_libraries(fusion wine uuid) add_importlibs(fusion shlwapi advapi32 dbghelp user32 msvcrt kernel32 ntdll) add_cd_file(TARGET fusion DESTINATION
reactos/Microsoft.NET/Framework/v1.0.3705
FOR all) add_cd_file(TARGET fusion DESTINATION
reactos/Microsoft.NET/Framework/v1.1.4322
FOR all) add_cd_file(TARGET fusion DESTINATION
reactos/Microsoft.NET/Framework/v2.0.50727
FOR all) -add_cd_file(TARGET fusion DESTINATION reactos/system32 FOR all) +add_cd_file(TARGET fusion DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/fusion/asmcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fusion/asmcache.…
============================================================================== --- trunk/reactos/dll/win32/fusion/asmcache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fusion/asmcache.c [iso-8859-1] Sat May 19 09:41:07 2012 @@ -41,6 +41,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(fusion); +static const WCHAR cache_mutex_nameW[] = + {'_','_','W','I','N','E','_','F','U','S','I','O','N','_','C','A','C','H','E','_','M','U','T','E','X','_','_',0}; + static BOOL create_full_path(LPCWSTR path) { LPWSTR new_path; @@ -126,6 +129,7 @@ IAssemblyCache IAssemblyCache_iface; LONG ref; + HANDLE lock; } IAssemblyCacheImpl; static inline IAssemblyCacheImpl *impl_from_IAssemblyCache(IAssemblyCache *iface) @@ -166,15 +170,27 @@ static ULONG WINAPI IAssemblyCacheImpl_Release(IAssemblyCache *iface) { - IAssemblyCacheImpl *This = impl_from_IAssemblyCache(iface); - ULONG refCount = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(ref before = %u)\n", This, refCount + 1); + IAssemblyCacheImpl *cache = impl_from_IAssemblyCache(iface); + ULONG refCount = InterlockedDecrement( &cache->ref ); + + TRACE("(%p)->(ref before = %u)\n", cache, refCount + 1); if (!refCount) - HeapFree(GetProcessHeap(), 0, This); - + { + CloseHandle( cache->lock ); + HeapFree( GetProcessHeap(), 0, cache ); + } return refCount; +} + +static void cache_lock( IAssemblyCacheImpl *cache ) +{ + WaitForSingleObject( cache->lock, INFINITE ); +} + +static void cache_unlock( IAssemblyCacheImpl *cache ) +{ + ReleaseMutex( cache->lock ); } static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface, @@ -183,10 +199,81 @@ LPCFUSION_INSTALL_REFERENCE pRefData, ULONG *pulDisposition) { - FIXME("(%p, %d, %s, %p, %p) stub!\n", iface, dwFlags, + HRESULT hr; + IAssemblyCacheImpl *cache = impl_from_IAssemblyCache(iface); + IAssemblyName *asmname, *next = NULL; + IAssemblyEnum *asmenum = NULL; + WCHAR *p, *path = NULL; + ULONG disp; + DWORD len; + + TRACE("(%p, 0%08x, %s, %p, %p)\n", iface, dwFlags, debugstr_w(pszAssemblyName), pRefData, pulDisposition); - return E_NOTIMPL; + if (pRefData) + { + FIXME("application reference not supported\n"); + return E_NOTIMPL; + } + hr = CreateAssemblyNameObject( &asmname, pszAssemblyName, CANOF_PARSE_DISPLAY_NAME, NULL ); + if (FAILED( hr )) + return hr; + + cache_lock( cache ); + + hr = CreateAssemblyEnum( &asmenum, NULL, asmname, ASM_CACHE_GAC, NULL ); + if (FAILED( hr )) + goto done; + + hr = IAssemblyEnum_GetNextAssembly( asmenum, NULL, &next, 0 ); + if (hr == S_FALSE) + { + if (pulDisposition) + *pulDisposition = IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED; + goto done; + } + hr = IAssemblyName_GetPath( next, NULL, &len ); + if (hr != HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER )) + goto done; + + if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) + { + hr = E_OUTOFMEMORY; + goto done; + } + hr = IAssemblyName_GetPath( next, path, &len ); + if (FAILED( hr )) + goto done; + + if (DeleteFileW( path )) + { + if ((p = strrchrW( path, '\\' ))) + { + *p = 0; + RemoveDirectoryW( path ); + if ((p = strrchrW( path, '\\' ))) + { + *p = 0; + RemoveDirectoryW( path ); + } + } + disp = IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED; + hr = S_OK; + } + else + { + disp = IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED; + hr = S_FALSE; + } + if (pulDisposition) *pulDisposition = disp; + +done: + IAssemblyName_Release( asmname ); + if (next) IAssemblyName_Release( next ); + if (asmenum) IAssemblyEnum_Release( asmenum ); + HeapFree( GetProcessHeap(), 0, path ); + cache_unlock( cache ); + return hr; } static HRESULT WINAPI IAssemblyCacheImpl_QueryAssemblyInfo(IAssemblyCache *iface, @@ -194,6 +281,7 @@ LPCWSTR pszAssemblyName, ASSEMBLY_INFO *pAsmInfo) { + IAssemblyCacheImpl *cache = impl_from_IAssemblyCache(iface); IAssemblyName *asmname, *next = NULL; IAssemblyEnum *asmenum = NULL; HRESULT hr; @@ -214,6 +302,8 @@ if (FAILED(hr)) return hr; + cache_lock( cache ); + hr = CreateAssemblyEnum(&asmenum, NULL, asmname, ASM_CACHE_GAC, NULL); if (FAILED(hr)) goto done; @@ -236,7 +326,7 @@ IAssemblyName_Release(asmname); if (next) IAssemblyName_Release(next); if (asmenum) IAssemblyEnum_Release(asmenum); - + cache_unlock( cache ); return hr; } @@ -264,9 +354,10 @@ LPCWSTR pszManifestFilePath, LPCFUSION_INSTALL_REFERENCE pRefData) { - static const WCHAR format[] = - {'%','s','\\','%','s','\\','%','s','_','_','%','s','\\',0}; - + static const WCHAR format[] = {'%','s','\\','%','s','\\','%','s','_','_','%','s','\\',0}; + static const WCHAR ext_exe[] = {'.','e','x','e',0}; + static const WCHAR ext_dll[] = {'.','d','l','l',0}; + IAssemblyCacheImpl *cache = impl_from_IAssemblyCache(iface); ASSEMBLY *assembly; LPWSTR filename; LPWSTR name = NULL; @@ -278,9 +369,6 @@ LPWSTR ext; HRESULT hr; - static const WCHAR ext_exe[] = {'.','e','x','e',0}; - static const WCHAR ext_dll[] = {'.','d','l','l',0}; - TRACE("(%p, %d, %s, %p)\n", iface, dwFlags, debugstr_w(pszManifestFilePath), pRefData); @@ -314,6 +402,8 @@ hr = assembly_get_version(assembly, &version); if (FAILED(hr)) goto done; + + cache_lock( cache ); get_assembly_directory(asmdir, MAX_PATH, assembly_get_architecture(assembly)); @@ -337,6 +427,7 @@ HeapFree(GetProcessHeap(), 0, version); HeapFree(GetProcessHeap(), 0, asmpath); assembly_release(assembly); + cache_unlock( cache ); return hr; } @@ -371,9 +462,13 @@ cache->IAssemblyCache_iface.lpVtbl = &AssemblyCacheVtbl; cache->ref = 1; - + cache->lock = CreateMutexW( NULL, FALSE, cache_mutex_nameW ); + if (!cache->lock) + { + HeapFree( GetProcessHeap(), 0, cache ); + return HRESULT_FROM_WIN32( GetLastError() ); + } *ppAsmCache = &cache->IAssemblyCache_iface; - return S_OK; } Modified: trunk/reactos/dll/win32/fusion/asmname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fusion/asmname.c…
============================================================================== --- trunk/reactos/dll/win32/fusion/asmname.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fusion/asmname.c [iso-8859-1] Sat May 19 09:41:07 2012 @@ -666,7 +666,7 @@ IAssemblyNameImpl *name; HRESULT hr; - TRACE("(%p, %s, %08x, %p) stub!\n", ppAssemblyNameObj, + TRACE("(%p, %s, %08x, %p)\n", ppAssemblyNameObj, debugstr_w(szAssemblyName), dwFlags, pvReserved); if (!ppAssemblyNameObj) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat May 19 09:41:07 2012 @@ -60,7 +60,7 @@ reactos/dll/win32/dbghelp # Synced to Wine-1.3.37 reactos/dll/win32/dciman32 # Synced to Wine-1.3.37 reactos/dll/win32/dwmapi # Synced to Wine-1.3.37 -reactos/dll/win32/fusion # Synced to Wine-1.3.37 +reactos/dll/win32/fusion # Synced to Wine-1.5.4 reactos/dll/win32/gdiplus # Synced to Wine-1.3.37 reactos/dll/win32/hhctrl.ocx # Autosync reactos/dll/win32/hlink # Synced to Wine-1.3.37
12 years, 7 months
1
0
0
0
[akhaldi] 56610: [MSSIGN32] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 09:26:02 2012 New Revision: 56610 URL:
http://svn.reactos.org/svn/reactos?rev=56610&view=rev
Log: [MSSIGN32] * Sync to Wine 1.5.4. Modified: trunk/reactos/dll/win32/mssign32/CMakeLists.txt trunk/reactos/dll/win32/mssign32/mssign32.spec trunk/reactos/dll/win32/mssign32/mssign32_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/mssign32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mssign32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/mssign32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mssign32/CMakeLists.txt [iso-8859-1] Sat May 19 09:26:02 2012 @@ -10,11 +10,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/mssign32.def) add_library(mssign32 SHARED ${SOURCE}) - set_module_type(mssign32 win32dll) - target_link_libraries(mssign32 wine) - add_importlibs(mssign32 msvcrt kernel32 ntdll) - add_cd_file(TARGET mssign32 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/mssign32/mssign32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mssign32/mssign3…
============================================================================== --- trunk/reactos/dll/win32/mssign32/mssign32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mssign32/mssign32.spec [iso-8859-1] Sat May 19 09:26:02 2012 @@ -2,11 +2,11 @@ @ stub -private DllUnregisterServer @ stub FreeCryptProvFromCert @ stub GetCryptProvFromCert -@ stub PvkFreeCryptProv -@ stub PvkGetCryptProv +@ stdcall PvkFreeCryptProv(ptr wstr long wstr) +@ stdcall PvkGetCryptProv(ptr wstr wstr long wstr wstr ptr ptr ptr) @ stub PvkPrivateKeyAcquireContext @ stub PvkPrivateKeyAcquireContextA -@ stub PvkPrivateKeyAcquireContextFromMemory +@ stdcall PvkPrivateKeyAcquireContextFromMemory(wstr long ptr long ptr wstr ptr ptr ptr) @ stub PvkPrivateKeyAcquireContextFromMemoryA @ stub PvkPrivateKeyLoad @ stub PvkPrivateKeyLoadA Modified: trunk/reactos/dll/win32/mssign32/mssign32_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mssign32/mssign3…
============================================================================== --- trunk/reactos/dll/win32/mssign32/mssign32_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mssign32/mssign32_main.c [iso-8859-1] Sat May 19 09:26:02 2012 @@ -24,7 +24,11 @@ #include "windef.h" #include "winbase.h" +#include "wincrypt.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mssign); BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID lpv ) { @@ -40,3 +44,33 @@ } return TRUE; } + + +HRESULT WINAPI PvkGetCryptProv(HWND hwnd, LPCWSTR pwszCaption, LPCWSTR pwszCapiProvider, + DWORD dwProviderType, LPCWSTR pwszPvkFile, LPCWSTR pwszKeyContainerName, + DWORD *pdwKeySpec, LPWSTR *ppwszTmpContainer, HCRYPTPROV *phCryptProv) +{ + FIXME("%p %s %s %d %s %s %p %p %p stub\n", hwnd, debugstr_w(pwszCaption), debugstr_w(pwszCapiProvider), + dwProviderType, debugstr_w(pwszPvkFile), debugstr_w(pwszKeyContainerName), + pdwKeySpec, ppwszTmpContainer, phCryptProv); + + return E_FAIL; +} + +BOOL WINAPI PvkPrivateKeyAcquireContextFromMemory(LPCWSTR pwszProvName, DWORD dwProvType, + BYTE *pbData, DWORD cbData, HWND hwndOwner, LPCWSTR pwszKeyName, + DWORD *pdwKeySpec, HCRYPTPROV *phCryptProv, LPWSTR *ppwszTmpContainer) +{ + FIXME("%s %d %p %d %p %s %p %p %p stub\n", debugstr_w(pwszProvName), dwProvType, + pbData, cbData, hwndOwner, debugstr_w(pwszKeyName), pdwKeySpec, + phCryptProv, ppwszTmpContainer); + + return FALSE; +} + +void WINAPI PvkFreeCryptProv(HCRYPTPROV hProv, LPCWSTR pwszCapiProvider, DWORD dwProviderType, + LPWSTR pwszTmpContainer) +{ + FIXME("%08lx %s %d %s stub\n", hProv, debugstr_w(pwszCapiProvider), dwProviderType, + debugstr_w(pwszTmpContainer)); +} Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat May 19 09:26:02 2012 @@ -109,7 +109,7 @@ reactos/dll/win32/msisys.ocx # Synced to Wine-1.3.37 reactos/dll/win32/msnet32 # Synced to Wine-1.3.37 reactos/dll/win32/msrle32 # Autosync -reactos/dll/win32/mssign32 # Synced to Wine-1.3.37 +reactos/dll/win32/mssign32 # Synced to Wine-1.5.4 reactos/dll/win32/mssip32 # Synced to Wine-1.3.37 reactos/dll/win32/mstask # Synced to Wine-1.3.37 reactos/dll/win32/msvcrt20 # Autosync
12 years, 7 months
1
0
0
0
[jimtabor] 56609: [Win32SS] - Fix test_child_window_from_point results. - Turn on process layout. - Miscellaneous changes and fixups.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat May 19 04:40:37 2012 New Revision: 56609 URL:
http://svn.reactos.org/svn/reactos?rev=56609&view=rev
Log: [Win32SS] - Fix test_child_window_from_point results. - Turn on process layout. - Miscellaneous changes and fixups. Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c trunk/reactos/win32ss/user/ntuser/winpos.c trunk/reactos/win32ss/user/ntuser/winpos.h trunk/reactos/win32ss/user/user32/misc/stubs.c trunk/reactos/win32ss/user/user32/user32.spec trunk/reactos/win32ss/user/user32/windows/window.c Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntstub…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] Sat May 19 04:40:37 2012 @@ -908,17 +908,6 @@ return 0; } -BOOL -APIENTRY -NtUserGetLayeredWindowAttributes( - HWND hwnd, - COLORREF *pcrKey, - BYTE *pbAlpha, - DWORD *pdwFlags) -{ - STUB; - return 0; -} DWORD APIENTRY @@ -1018,19 +1007,6 @@ /* * @unimplemented */ -HWND APIENTRY -NtUserRealChildWindowFromPoint(HWND Parent, - LONG x, - LONG y) -{ - STUB - - return 0; -} - -/* - * @unimplemented - */ DWORD APIENTRY NtUserSetImeOwnerWindow(DWORD Unknown0, DWORD Unknown1) @@ -1038,6 +1014,18 @@ STUB return 0; +} + +BOOL +APIENTRY +NtUserGetLayeredWindowAttributes( + HWND hwnd, + COLORREF *pcrKey, + BYTE *pbAlpha, + DWORD *pdwFlags) +{ + STUB; + return 0; } /* Modified: trunk/reactos/win32ss/user/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] Sat May 19 04:40:37 2012 @@ -150,10 +150,8 @@ if (!Wnd) return FALSE; style = Wnd->style; - if (!(style & WS_VISIBLE) && - Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE; - if ((style & WS_MINIMIZE) && - Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE; + if (!(style & WS_VISIBLE)) return FALSE; + if (style & WS_MINIMIZE) return FALSE; if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE; return TRUE; /* FIXME: This window could be disable because the child that closed @@ -1783,8 +1781,10 @@ WPARAM wParam = SIZE_RESTORED; IntGetClientRect(Wnd, &Rect); + lParam = MAKELONG(Rect.right-Rect.left, Rect.bottom-Rect.top); Wnd->state &= ~WNDS_SENDSIZEMOVEMSGS; + if (Wnd->style & WS_MAXIMIZE) { wParam = SIZE_MAXIMIZED; @@ -1792,9 +1792,10 @@ else if (Wnd->style & WS_MINIMIZE) { wParam = SIZE_MINIMIZED; + lParam = 0; } - co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_SIZE, wParam, MAKELONG(Rect.right-Rect.left, Rect.bottom-Rect.top)); + co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_SIZE, wParam, lParam); if (Wnd->spwndParent == UserGetDesktopWindow()) // Wnd->spwndParent->fnid != FNID_DESKTOP ) lParam = MAKELONG(Wnd->rcClient.left, Wnd->rcClient.top); @@ -2010,8 +2011,7 @@ UserReferenceObject(ScopeWin); - if (Point->x - ScopeWin->rcClient.left < ScopeWin->rcClient.right && - Point->y - ScopeWin->rcClient.top < ScopeWin->rcClient.bottom ) + if ( RECTL_bPointInRect(&ScopeWin->rcClient, Point->x, Point->y) ) { List = IntWinListChildren(ScopeWin); if(List) @@ -2075,6 +2075,99 @@ ASSERT_REFS_CO(ScopeWin); return Window; +} + +PWND FASTCALL +IntRealChildWindowFromPoint(PWND Parent, LONG x, LONG y) +{ + POINTL Pt; + HWND *List, *phWnd; + PWND pwndHit = NULL; + + Pt.x = x; + Pt.y = y; + + if (Parent != UserGetDesktopWindow()) + { + Pt.x += Parent->rcClient.left; + Pt.y += Parent->rcClient.top; + } + + if (!IntPtInWindow(Parent, Pt.x, Pt.y)) return NULL; + + if ((List = IntWinListChildren(Parent))) + { + for (phWnd = List; *phWnd; phWnd++) + { + PWND Child; + if ((Child = UserGetWindowObject(*phWnd))) + { + if ( Child->style & WS_VISIBLE && IntPtInWindow(Child, Pt.x, Pt.y) ) + { + if ( Child->pcls->atomClassName != gpsi->atomSysClass[ICLS_BUTTON] || + (Child->style & BS_TYPEMASK) != BS_GROUPBOX ) + { + ExFreePool(List); + return Child; + } + pwndHit = Child; + } + } + } + ExFreePool(List); + } + return pwndHit ? pwndHit : Parent; +} + +PWND APIENTRY +IntChildWindowFromPointEx(PWND Parent, LONG x, LONG y, UINT uiFlags) +{ + POINTL Pt; + HWND *List, *phWnd; + PWND pwndHit = NULL; + + Pt.x = x; + Pt.y = y; + + if (Parent != UserGetDesktopWindow()) + { + if (Parent->ExStyle & WS_EX_LAYOUTRTL) + Pt.x = Parent->rcClient.right - Pt.x; + else + Pt.x += Parent->rcClient.left; + Pt.y += Parent->rcClient.top; + } + + if (!IntPtInWindow(Parent, Pt.x, Pt.y)) return NULL; + + if ((List = IntWinListChildren(Parent))) + { + for (phWnd = List; *phWnd; phWnd++) + { + PWND Child; + if ((Child = UserGetWindowObject(*phWnd))) + { + if (uiFlags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED)) + { + if (!(Child->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE)) continue; + if ((Child->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED)) continue; + } + + if (uiFlags & CWP_SKIPTRANSPARENT) + { + if (Child->ExStyle & WS_EX_TRANSPARENT) continue; + } + + if (IntPtInWindow(Child, Pt.x, Pt.y)) + { + pwndHit = Child; + break; + } + } + } + ExFreePool(List); + } + return pwndHit ? pwndHit : Parent; } HDWP @@ -2191,7 +2284,7 @@ winpos->pos.hwnd, winpos->pos.hwndInsertAfter, winpos->pos.x, winpos->pos.y, winpos->pos.cx, winpos->pos.cy, winpos->pos.flags); - pwnd = UserGetWindowObject(winpos->pos.hwnd); + pwnd = (PWND)UserGetObject(gHandleTable, winpos->pos.hwnd, otWindow); if (!pwnd) continue; @@ -2207,7 +2300,7 @@ /* Yes it's a pointer inside Win32k! */ lRes = co_IntSendMessageNoWait( winpos->pos.hwnd, WM_ASYNC_SETWINDOWPOS, 0, (LPARAM)ppos); /* We handle this the same way as Event Hooks and Hooks. */ - if ( -1 == (int) lRes ) + if ( !lRes ) { ExFreePoolWithTag(ppos, USERTAG_SWP); } @@ -2240,61 +2333,16 @@ LONG y, UINT uiFlags) { - PWND Parent; - POINTL Pt; - HWND Ret; - HWND *List, *phWnd; - - if(!(Parent = UserGetWindowObject(hwndParent))) - { - return NULL; - } - - Pt.x = x; - Pt.y = y; - - if(Parent->head.h != IntGetDesktopWindow()) - { - Pt.x += Parent->rcClient.left; - Pt.y += Parent->rcClient.top; - } - - if(!IntPtInWindow(Parent, Pt.x, Pt.y)) - { - return NULL; - } - - Ret = Parent->head.h; - if((List = IntWinListChildren(Parent))) - { - for(phWnd = List; *phWnd; phWnd++) - { - PWND Child; - if((Child = UserGetWindowObject(*phWnd))) - { - if(!(Child->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE)) - { - continue; - } - if((Child->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED)) - { - continue; - } - if((Child->ExStyle & WS_EX_TRANSPARENT) && (uiFlags & CWP_SKIPTRANSPARENT)) - { - continue; - } - if(IntPtInWindow(Child, Pt.x, Pt.y)) - { - Ret = Child->head.h; - break; - } - } - } - ExFreePool(List); - } - - return Ret; + PWND pwndParent; + TRACE("Enter NtUserChildWindowFromPointEx\n"); + UserEnterExclusive(); + if ((pwndParent = UserGetWindowObject(hwndParent))) + { + pwndParent = IntChildWindowFromPointEx(pwndParent, x, y, uiFlags); + } + UserLeave(); + TRACE("Leave NtUserChildWindowFromPointEx\n"); + return pwndParent ? UserHMGetHandle(pwndParent) : NULL; } /* @@ -2521,9 +2569,9 @@ goto Exit; } - co_WinPosMinMaximize(pWnd, cmd, &NewPos); - - SwFlags = Hide ? SWP_NOACTIVATE|SWP_NOZORDER|SWP_FRAMECHANGED : SWP_NOZORDER|SWP_FRAMECHANGED; + SwFlags = co_WinPosMinMaximize(pWnd, cmd, &NewPos); + + SwFlags |= Hide ? SWP_NOACTIVATE : 0; co_WinPosSetWindowPos( pWnd, NULL, @@ -2556,6 +2604,26 @@ return NtUserSetWindowPos(hWnd, 0, X, Y, nWidth, nHeight, (bRepaint ? SWP_NOZORDER | SWP_NOACTIVATE : SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW)); +} + +/* + * @implemented + */ +HWND APIENTRY +NtUserRealChildWindowFromPoint(HWND Parent, + LONG x, + LONG y) +{ + PWND pwndParent; + TRACE("Enter NtUserRealChildWindowFromPoint\n"); + UserEnterShared(); + if ((pwndParent = UserGetWindowObject(Parent))) + { + pwndParent = IntRealChildWindowFromPoint(pwndParent, x, y); + } + UserLeave(); + TRACE("Leave NtUserRealChildWindowFromPoint\n"); + return pwndParent ? UserHMGetHandle(pwndParent) : NULL; } /* Modified: trunk/reactos/win32ss/user/ntuser/winpos.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/winpos.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winpos.h [iso-8859-1] Sat May 19 04:40:37 2012 @@ -53,4 +53,5 @@ BOOLEAN FASTCALL co_WinPosShowWindow(PWND Window, INT Cmd); void FASTCALL co_WinPosSendSizeMove(PWND Window); PWND FASTCALL co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest); -VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window); +VOID FASTCALL co_WinPosActivateOtherWindow(PWND); +PWND FASTCALL IntRealChildWindowFromPoint(PWND,LONG,LONG); Modified: trunk/reactos/win32ss/user/user32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/s…
============================================================================== --- trunk/reactos/win32ss/user/user32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/stubs.c [iso-8859-1] Sat May 19 04:40:37 2012 @@ -67,28 +67,6 @@ PCLIENTINFO pci = GetWin32ClientInfo(); return pci->dwCompatFlags2; -} - -/* - * @unimplemented - */ -UINT -WINAPI -GetInternalWindowPos( - HWND hwnd, - LPRECT rectWnd, - LPPOINT ptIcon - ) -{ - WINDOWPLACEMENT wndpl; - - if (GetWindowPlacement(hwnd, &wndpl)) - { - if (rectWnd) *rectWnd = wndpl.rcNormalPosition; - if (ptIcon) *ptIcon = wndpl.ptMinPosition; - return wndpl.showCmd; - } - return 0; } /* Modified: trunk/reactos/win32ss/user/user32/user32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/user32…
============================================================================== --- trunk/reactos/win32ss/user/user32/user32.spec [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/user32.spec [iso-8859-1] Sat May 19 04:40:37 2012 @@ -286,7 +286,7 @@ @ stdcall GetIconInfo(long ptr) @ stdcall GetInputDesktop() @ stdcall GetInputState() -@ stdcall GetInternalWindowPos(long ptr ptr) ; direct call NtUserGetInternalWindowPos +@ stdcall GetInternalWindowPos(long ptr ptr) NtUserGetInternalWindowPos @ stdcall GetKBCodePage() @ stdcall GetKeyNameTextA(long ptr long) @ stdcall GetKeyNameTextW(long ptr long) Modified: trunk/reactos/win32ss/user/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/window.c [iso-8859-1] Sat May 19 04:40:37 2012 @@ -1028,21 +1028,12 @@ /* - * @unimplemented + * @implemented */ BOOL WINAPI GetProcessDefaultLayout(DWORD *pdwDefaultLayout) { - if (!pdwDefaultLayout) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - UNIMPLEMENTED; - - *pdwDefaultLayout = 0; - return TRUE; +return (BOOL)NtUserCallOneParam( (DWORD_PTR)pdwDefaultLayout, ONEPARAM_ROUTINE_GETPROCDEFLAYOUT); } @@ -1659,7 +1650,7 @@ RealChildWindowFromPoint(HWND hwndParent, POINT ptParentClientCoords) { - return ChildWindowFromPointEx(hwndParent, ptParentClientCoords, CWP_SKIPTRANSPARENT | CWP_SKIPINVISIBLE); + return NtUserRealChildWindowFromPoint(hwndParent, ptParentClientCoords.x, ptParentClientCoords.y); } /* @@ -1673,16 +1664,12 @@ /* - * @unimplemented + * @implemented */ BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout) { - if (dwDefaultLayout == 0) - return TRUE; - - UNIMPLEMENTED; - return FALSE; +return NtUserCallOneParam( (DWORD_PTR)dwDefaultLayout, ONEPARAM_ROUTINE_SETPROCDEFLAYOUT); }
12 years, 7 months
1
0
0
0
[jimtabor] 56608: [Win32k] - Fix all the wine Win test_SetForegroundWindow and todo tests.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri May 18 18:08:54 2012 New Revision: 56608 URL:
http://svn.reactos.org/svn/reactos?rev=56608&view=rev
Log: [Win32k] - Fix all the wine Win test_SetForegroundWindow and todo tests. Modified: trunk/reactos/win32ss/user/ntuser/focus.c trunk/reactos/win32ss/user/ntuser/simplecall.c Modified: trunk/reactos/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] Fri May 18 18:08:54 2012 @@ -229,6 +229,38 @@ return NULL; } +VOID FASTCALL +FindRemoveAsyncMsg(PWND Wnd) +{ + PUSER_MESSAGE_QUEUE MessageQueue; + PUSER_SENT_MESSAGE Message; + PLIST_ENTRY Entry; + + if (!Wnd) return; + + MessageQueue = Wnd->head.pti->MessageQueue; + + if (!IsListEmpty(&MessageQueue->SentMessagesListHead)) + { + // Scan sent queue messages to see if we received async messages. + Entry = MessageQueue->SentMessagesListHead.Flink; + Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); + do + { + if (Message->Msg.message == WM_ASYNC_SETACTIVEWINDOW && + Message->Msg.hwnd == UserHMGetHandle(Wnd) && + Message->Msg.wParam == 0 ) + { + TRACE("ASYNC SAW: Found one in the Sent Msg Queue! %p\n", Message->Msg.hwnd); + RemoveEntryList(Entry); // Purge the entry. + } + Entry = Message->ListEntry.Flink; + Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); + } + while (Entry != &MessageQueue->SentMessagesListHead); + } +} + /* Can the system force foreground from one or more conditions. */ @@ -307,15 +339,17 @@ { IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue); gptiForeground = Wnd->head.pti; - fgRet = TRUE; - } -/* - Fix FG Bounce with regedit but breaks test_SFW todos: +/* Henri Verbeet, What happens is that we get the WM_WINE_SETACTIVEWINDOW message sent by the other thread after we already changed the foreground window back to our own window. */ + FindRemoveAsyncMsg(Wnd); // Do this to fix test_SFW todos! + fgRet = TRUE; + } + + // Fix FG Bounce with regedit. if (hWndPrev != hWnd ) { if (PrevForegroundQueue && Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Fri May 18 18:08:54 2012 @@ -569,7 +569,9 @@ break; case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW: + TRACE("co_IntSetForegroundWindow 1 %p\n",hWnd); Ret = co_IntSetForegroundWindow(Window); + TRACE("co_IntSetForegroundWindow 2 \n"); break; case HWNDLOCK_ROUTINE_UPDATEWINDOW:
12 years, 7 months
1
0
0
0
[ekohl] 56607: [SYSSETUP] - Create builtin LSA accounts. - Add privileges to the accounts.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu May 17 21:30:30 2012 New Revision: 56607 URL:
http://svn.reactos.org/svn/reactos?rev=56607&view=rev
Log: [SYSSETUP] - Create builtin LSA accounts. - Add privileges to the accounts. Modified: trunk/reactos/dll/win32/syssetup/globals.h trunk/reactos/dll/win32/syssetup/install.c trunk/reactos/dll/win32/syssetup/precomp.h trunk/reactos/dll/win32/syssetup/security.c Modified: trunk/reactos/dll/win32/syssetup/globals.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/globals…
============================================================================== --- trunk/reactos/dll/win32/syssetup/globals.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/globals.h [iso-8859-1] Thu May 17 21:30:30 2012 @@ -64,6 +64,7 @@ /* security.c */ NTSTATUS SetAccountDomain(LPCWSTR DomainName, PSID DomainSid); +VOID InstallSecurity(VOID); /* wizard.c */ VOID InstallWizard (VOID); Modified: trunk/reactos/dll/win32/syssetup/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install…
============================================================================== --- trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] Thu May 17 21:30:30 2012 @@ -956,6 +956,8 @@ InstallWizard(); + InstallSecurity(); + /* Create the Administrator account */ if (!SamCreateUser(L"Administrator", L"", AdminSid)) { Modified: trunk/reactos/dll/win32/syssetup/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/precomp…
============================================================================== --- trunk/reactos/dll/win32/syssetup/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/precomp.h [iso-8859-1] Thu May 17 21:30:30 2012 @@ -22,7 +22,9 @@ #include <string.h> #include <pseh/pseh2.h> #include <time.h> +#include <ntlsa.h> #include <ntsecapi.h> +#include <sddl.h> #include "globals.h" #include "resource.h" Modified: trunk/reactos/dll/win32/syssetup/security.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/securit…
============================================================================== --- trunk/reactos/dll/win32/syssetup/security.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/security.c [iso-8859-1] Thu May 17 21:30:30 2012 @@ -85,3 +85,188 @@ return Status; } + + +static +VOID +InstallBuiltinAccounts(VOID) +{ + LPWSTR BuiltinAccounts[] = { + L"S-1-1-0", /* Everyone */ + L"S-1-5-4", /* Interactive */ + L"S-1-5-6", /* Service */ + L"S-1-5-19", /* Local Service */ + L"S-1-5-20", /* Network Service */ + L"S-1-5-32-544", /* Administrators */ + L"S-1-5-32-545", /* Users */ + L"S-1-5-32-547", /* Power Users */ + L"S-1-5-32-551", /* Backup Operators */ + L"S-1-5-32-555"}; /* Remote Desktop Users */ + LSA_OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + LSA_HANDLE PolicyHandle = NULL; + LSA_HANDLE AccountHandle = NULL; + PSID AccountSid; + ULONG i; + + DPRINT("InstallBuiltinAccounts()\n"); + + memset(&ObjectAttributes, 0, sizeof(LSA_OBJECT_ATTRIBUTES)); + + Status = LsaOpenPolicy(NULL, + &ObjectAttributes, + POLICY_CREATE_ACCOUNT, + &PolicyHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("LsaOpenPolicy failed (Status %08lx)\n", Status); + return; + } + + for (i = 0; i < 10; i++) + { + ConvertStringSidToSid(BuiltinAccounts[i], &AccountSid); + + Status = LsaCreateAccount(PolicyHandle, + AccountSid, + 0, + &AccountHandle); + if (NT_SUCCESS(Status)) + { + LsaClose(AccountHandle); + } + + LocalFree(AccountSid); + } + + LsaClose(PolicyHandle); +} + + +static +VOID +InstallPrivileges(VOID) +{ + HINF hSecurityInf = INVALID_HANDLE_VALUE; + LSA_OBJECT_ATTRIBUTES ObjectAttributes; + WCHAR szPrivilegeString[256]; + WCHAR szSidString[256]; + INFCONTEXT InfContext; + DWORD i; + PRIVILEGE_SET PrivilegeSet; + PSID AccountSid; + NTSTATUS Status; + LSA_HANDLE PolicyHandle = NULL; + LSA_HANDLE AccountHandle; + + DPRINT("InstallPrivileges()\n"); + + hSecurityInf = SetupOpenInfFileW(L"defltws.inf", //szNameBuffer, + NULL, + INF_STYLE_WIN4, + NULL); + if (hSecurityInf == INVALID_HANDLE_VALUE) + { + DPRINT1("SetupOpenInfFileW failed\n"); + return; + } + + memset(&ObjectAttributes, 0, sizeof(LSA_OBJECT_ATTRIBUTES)); + + Status = LsaOpenPolicy(NULL, + &ObjectAttributes, + POLICY_CREATE_ACCOUNT, + &PolicyHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("LsaOpenPolicy failed (Status %08lx)\n", Status); + goto done; + } + + if (!SetupFindFirstLineW(hSecurityInf, + L"Privilege Rights", + NULL, + &InfContext)) + { + DPRINT1("SetupFindfirstLineW failed\n"); + goto done; + } + + PrivilegeSet.PrivilegeCount = 1; + PrivilegeSet.Control = 0; + + do + { + /* Retrieve the privilege name */ + if (!SetupGetStringFieldW(&InfContext, + 0, + szPrivilegeString, + 256, + NULL)) + { + DPRINT1("SetupGetStringFieldW() failed\n"); + goto done; + } + DPRINT("Privilege: %S\n", szPrivilegeString); + + if (!LookupPrivilegeValueW(NULL, + szPrivilegeString, + &(PrivilegeSet.Privilege[0].Luid))) + { + DPRINT1("LookupPrivilegeNameW() failed\n"); + goto done; + } + + PrivilegeSet.Privilege[0].Attributes = 0; + + for (i = 0; i < SetupGetFieldCount(&InfContext); i++) + { + if (!SetupGetStringFieldW(&InfContext, + i + 1, + szSidString, + 256, + NULL)) + { + DPRINT1("SetupGetStringFieldW() failed\n"); + goto done; + } + DPRINT("SID: %S\n", szSidString); + + ConvertStringSidToSid(szSidString, &AccountSid); + + Status = LsaOpenAccount(PolicyHandle, + AccountSid, + ACCOUNT_VIEW | ACCOUNT_ADJUST_PRIVILEGES, + &AccountHandle); + if (NT_SUCCESS(Status)) + { + Status = LsaAddPrivilegesToAccount(AccountHandle, + &PrivilegeSet); + if (!NT_SUCCESS(Status)) + { + DPRINT1("LsaAddPrivilegesToAccount() failed (Status %08lx)\n", Status); + } + + LsaClose(AccountHandle); + } + + LocalFree(AccountSid); + } + + } + while (SetupFindNextLine(&InfContext, &InfContext)); + +done: + if (PolicyHandle != NULL) + LsaClose(PolicyHandle); + + if (hSecurityInf != INVALID_HANDLE_VALUE) + SetupCloseInfFile(hSecurityInf); +} + +VOID +InstallSecurity(VOID) +{ + InstallBuiltinAccounts(); + InstallPrivileges(); +}
12 years, 7 months
1
0
0
0
[tkreuzer] 56606: [GDI32_APITEST] - Create a global 4bpp dib section for tests - More tests for GetDIBits
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 17 18:56:00 2012 New Revision: 56606 URL:
http://svn.reactos.org/svn/reactos?rev=56606&view=rev
Log: [GDI32_APITEST] - Create a global 4bpp dib section for tests - More tests for GetDIBits Modified: trunk/rostests/apitests/gdi32/GetDIBits.c trunk/rostests/apitests/gdi32/init.c trunk/rostests/apitests/gdi32/init.h Modified: trunk/rostests/apitests/gdi32/GetDIBits.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetDIBits.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetDIBits.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetDIBits.c [iso-8859-1] Thu May 17 18:56:00 2012 @@ -8,164 +8,429 @@ #include <stdio.h> #include <wine/test.h> #include <windows.h> +#include "init.h" + +void +Test_GetDIBits_xBpp( + ULONG cBitsPixel) +{ + UCHAR ajBuffer[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)]; + PBITMAPINFO pbmi = (PBITMAPINFO)ajBuffer; + HBITMAP hbmp; + ULONG cjSizeImage, cColors; + HDC hdc; + + hdc = GetDC(0); + hbmp = CreateBitmap(3, 3, 1, cBitsPixel, NULL); + + /* Fill in the size field */ + ZeroMemory(pbmi, sizeof(ajBuffer)); + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + + /* Get info */ + ok_int(GetDIBits(hdc, hbmp, 0, 0, NULL, pbmi, DIB_RGB_COLORS), 1); + cjSizeImage = (((pbmi->bmiHeader.biWidth * pbmi->bmiHeader.biBitCount) + 31) & ~31) * pbmi->bmiHeader.biHeight / 8; + cColors = cBitsPixel <= 8 ? 1 << pbmi->bmiHeader.biBitCount : 0; + + ok_int(pbmi->bmiHeader.biSize, sizeof(BITMAPINFOHEADER)); + ok_int(pbmi->bmiHeader.biWidth, 3); + ok_int(pbmi->bmiHeader.biHeight, 3); + ok_int(pbmi->bmiHeader.biPlanes, 1); + ok_int(pbmi->bmiHeader.biBitCount, cBitsPixel); + ok_int(pbmi->bmiHeader.biCompression, (cBitsPixel == 16) || (cBitsPixel == 32) ? BI_BITFIELDS : BI_RGB); + ok_int(pbmi->bmiHeader.biSizeImage, cjSizeImage); + ok_int(pbmi->bmiHeader.biXPelsPerMeter, 0); + ok_int(pbmi->bmiHeader.biYPelsPerMeter, 0); + ok_int(pbmi->bmiHeader.biClrUsed, cColors); + ok_int(pbmi->bmiHeader.biClrImportant, cColors); + +// pbmi->bmiHeader.biSizeImage = 0; + //ok_int(GetDIBits(NULL, hbmp, 0, 0, NULL, pbmi, DIB_RGB_COLORS), 1); + + /* Test a bitmap with values partly set */ + ZeroMemory(pbmi, sizeof(BITMAPINFO)); + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = 12; + pbmi->bmiHeader.biHeight = 14; + pbmi->bmiHeader.biPlanes = 2; + pbmi->bmiHeader.biBitCount = 0; // keep biBitCount == 0! + pbmi->bmiHeader.biCompression = 7; + pbmi->bmiHeader.biSizeImage = 123; + ok_int(GetDIBits(hdc, hbmp, 0, 5, NULL, pbmi, DIB_RGB_COLORS), 1); + ok_int(pbmi->bmiHeader.biWidth, 3); + ok_int(pbmi->bmiHeader.biHeight, 3); + ok_int(pbmi->bmiHeader.biPlanes, 1); + ok_int(pbmi->bmiHeader.biBitCount, cBitsPixel); + ok_int(pbmi->bmiHeader.biSizeImage, cjSizeImage); + ok_int(pbmi->bmiHeader.biXPelsPerMeter, 0); + ok_int(pbmi->bmiHeader.biYPelsPerMeter, 0); + ok_int(pbmi->bmiHeader.biClrUsed, cColors); + ok_int(pbmi->bmiHeader.biClrImportant, cColors); + + +#if 0 + /* Get info including the color table */ + ZeroMemory(pbmi, sizeof(ajBuffer)); + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biBitCount = 1; + ok_int(GetDIBits(NULL, hbmp, 0, 0, NULL, pbmi, DIB_PAL_COLORS), 1); + + /* Check a different bit depth */ + pbmi->bmiHeader.biBitCount, cBitsPixel = (cBitsPixel == 1) ? 8 : 1; + ok_int(GetDIBits(hdc, hbmp, 0, 0, NULL, pbmi, DIB_RGB_COLORS), 1); + ok_int(pbmi->bmiHeader.biBitCount, (cBitsPixel == 1) ? 8 : 1); + + /* Get the bits */ + SetLastError(0); + ok_int(GetDIBits(hdc, hbmp, 0, 4, pvBits, pbmi, DIB_PAL_COLORS), 3); + ok_int(GetDIBits(hdc, hbmp, 3, 7, pvBits, pbmi, DIB_RGB_COLORS), 1); + ok_err(0); + + pbmi->bmiHeader.biPlanes = 2; + pbmi->bmiHeader.biClrUsed = 0; + ok_int(GetDIBits(hdc, hbmp, 0, 4, pvBits, pbmi, DIB_RGB_COLORS), 3); +#endif + + DeleteObject(hbmp); + ReleaseDC(NULL, hdc); +} void Test_GetDIBits() { - HDC hdcScreen, hdcMem; - HBITMAP hbmp; - PBITMAPINFO pbi; - INT ret, ScreenBpp; - DWORD ajBits[10] = {0xff, 0x00, 0xcc, 0xf0, 0x0f}; + HDC hdcScreen, hdcMem; + HBITMAP hbmp; + PBITMAPINFO pbi; + PBITMAPCOREHEADER pbch; + PBITMAPV5HEADER pbV5Header; + INT ScreenBpp; + DWORD ajBits[100] = {0xff, 0x00, 0xcc, 0xf0, 0x0f}; + PVOID pvBits; + ULONG cjSizeImage; pbi = malloc(sizeof(BITMAPV5HEADER) + 256 * sizeof(DWORD)); - - hdcScreen = GetDC(NULL); - ok(hdcScreen != 0, "GetDC failed, skipping tests\n"); - if (hdcScreen == NULL) return; + pbch = (PVOID)pbi; + pbV5Header = (PVOID)pbi; + + hdcScreen = GetDC(NULL); + ok(hdcScreen != 0, "GetDC failed, skipping tests\n"); + if (hdcScreen == NULL) return; hdcMem = CreateCompatibleDC(0); - ok(hdcMem != 0, "CreateCompatibleDC failed, skipping tests\n"); - if (hdcMem == NULL) return; - - hbmp = CreateCompatibleBitmap(hdcScreen, 16, 16); - ok(hbmp != NULL, "CreateCompatibleBitmap failed\n"); - - /* misc */ - SetLastError(ERROR_SUCCESS); - ok(GetDIBits(0, 0, 0, 0, NULL, NULL, 0) == 0, "\n"); - ok_err(ERROR_INVALID_PARAMETER); - - SetLastError(ERROR_SUCCESS); - ok(GetDIBits((HDC)2345, 0, 0, 0, NULL, NULL, 0) == 0, "\n"); - ok_err(ERROR_INVALID_PARAMETER); - - SetLastError(ERROR_SUCCESS); - ok(GetDIBits((HDC)2345, hbmp, 0, 0, NULL, NULL, 0) == 0, "\n"); - ok_err(ERROR_INVALID_PARAMETER); - - SetLastError(ERROR_SUCCESS); - ok(GetDIBits((HDC)2345, hbmp, 0, 15, NULL, pbi, 0) == 0, "\n"); - ok_err(ERROR_INVALID_PARAMETER); - - - - /* null hdc */ - SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - ok(GetDIBits(NULL, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "\n"); - ok_err(ERROR_INVALID_PARAMETER); - - /* null bitmap */ - SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - ok(GetDIBits(hdcScreen, NULL, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "\n"); - ok_err(ERROR_SUCCESS); - - /* 0 scan lines */ - SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - ok(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); - ok_err(ERROR_SUCCESS); - - /* null bitmap info - crashes XP*/ - //SetLastError(ERROR_SUCCESS); - //ok(GetDIBits(hdcScreen, NULL, 0, 15, NULL, NULL, DIB_RGB_COLORS) == 0); - //ok(GetLastError() == ERROR_INVALID_PARAMETER); - - /* bad bmi colours (uUsage) */ - SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, 100) == 0, "\n"); - ok_err(ERROR_SUCCESS); - ok(pbi->bmiHeader.biWidth == 0, "\n"); - ok(pbi->bmiHeader.biHeight == 0, "\n"); - ok(pbi->bmiHeader.biBitCount == 0, "\n"); - ok(pbi->bmiHeader.biSizeImage == 0, "\n"); - - /* basic call */ - SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); - ok_err(ERROR_SUCCESS); - ScreenBpp = GetDeviceCaps(hdcScreen, BITSPIXEL); - ok(pbi->bmiHeader.biWidth == 16, "\n"); - ok(pbi->bmiHeader.biHeight == 16, "\n"); - ok(pbi->bmiHeader.biBitCount == ScreenBpp, "\n"); - ok(pbi->bmiHeader.biSizeImage == (16 * 16) * (ScreenBpp / 8), "\n"); + ok(hdcMem != 0, "CreateCompatibleDC failed, skipping tests\n"); + if (hdcMem == NULL) return; + + hbmp = CreateCompatibleBitmap(hdcScreen, 16, 16); + ok(hbmp != NULL, "CreateCompatibleBitmap failed\n"); + + /* misc */ + SetLastError(ERROR_SUCCESS); + ok(GetDIBits(0, 0, 0, 0, NULL, NULL, 0) == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + ok(GetDIBits((HDC)2345, 0, 0, 0, NULL, NULL, 0) == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + ok(GetDIBits((HDC)2345, hbmp, 0, 0, NULL, NULL, 0) == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + ok(GetDIBits((HDC)2345, hbmp, 0, 15, NULL, pbi, 0) == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + + + /* null hdc */ + SetLastError(ERROR_SUCCESS); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok(GetDIBits(NULL, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + /* null bitmap */ + SetLastError(ERROR_SUCCESS); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok(GetDIBits(hdcScreen, NULL, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "\n"); + ok_err(ERROR_SUCCESS); + + /* 0 scan lines */ + SetLastError(ERROR_SUCCESS); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); + ok_err(ERROR_SUCCESS); + + /* null bitmap info - crashes XP*/ + //SetLastError(ERROR_SUCCESS); + //ok(GetDIBits(hdcScreen, NULL, 0, 15, NULL, NULL, DIB_RGB_COLORS) == 0); + //ok(GetLastError() == ERROR_INVALID_PARAMETER); + + /* bad bmi colours (uUsage) */ + SetLastError(0); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, 100) == 0, "\n"); + ok_err(ERROR_SUCCESS); + ok(pbi->bmiHeader.biWidth == 0, "\n"); + ok(pbi->bmiHeader.biHeight == 0, "\n"); + ok(pbi->bmiHeader.biBitCount == 0, "\n"); + ok(pbi->bmiHeader.biSizeImage == 0, "\n"); + + /* basic call */ + SetLastError(ERROR_SUCCESS); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); + ok_err(ERROR_SUCCESS); + ScreenBpp = GetDeviceCaps(hdcScreen, BITSPIXEL); + ok(pbi->bmiHeader.biWidth == 16, "\n"); + ok(pbi->bmiHeader.biHeight == 16, "\n"); + ok(pbi->bmiHeader.biBitCount == ScreenBpp, "\n"); + ok(pbi->bmiHeader.biSizeImage == (16 * 16) * (ScreenBpp / 8), "\n"); /* Test if COREHEADER is supported */ - pbi->bmiHeader.biSize = sizeof(BITMAPCOREHEADER); - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); - ok(pbi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER), "\n"); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPCOREHEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biSize, sizeof(BITMAPCOREHEADER)); + ok_int(pbch->bcWidth, 16); + ok_int(pbch->bcHeight, 16); + ok_int(pbch->bcPlanes, 1); + //ok_int(pbch->bcBitCount, ScreenBpp > 16 ? 24 : ScreenBpp); // fails on XP with screenbpp == 16 /* Test different header sizes */ - pbi->bmiHeader.biSize = sizeof(BITMAPCOREHEADER) + 4; - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "should fail.\n"); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER) + 4; - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "should fail.\n"); - pbi->bmiHeader.biSize = sizeof(BITMAPV5HEADER); - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) > 0, "should not fail.\n"); - pbi->bmiHeader.biSize = sizeof(BITMAPV5HEADER) + 4; - ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) > 0, "should not fail.\n"); - - - DeleteObject(hbmp); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPCOREHEADER) + 4; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 0); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER) + 4; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPV4HEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPV4HEADER) + 4; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPV5HEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPV5HEADER) + 4; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbV5Header->bV5RedMask, 0); + ok_int(pbV5Header->bV5GreenMask, 0); + ok_int(pbV5Header->bV5BlueMask, 0); + ok_int(pbV5Header->bV5AlphaMask, 0); + ok_int(pbV5Header->bV5CSType, 0); + // CIEXYZTRIPLE bV5Endpoints; + ok_int(pbV5Header->bV5GammaRed, 0); + ok_int(pbV5Header->bV5GammaGreen, 0); + ok_int(pbV5Header->bV5GammaBlue, 0); + ok_int(pbV5Header->bV5Intent, 0); + ok_int(pbV5Header->bV5ProfileData, 0); + ok_int(pbV5Header->bV5ProfileSize, 0); + ok_int(pbV5Header->bV5Reserved, 0); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 234, 43, NULL, pbi, DIB_RGB_COLORS), 1); + + DeleteObject(hbmp); /* Test a mono bitmap */ hbmp = CreateBitmap(13, 7, 1, 1, ajBits); ok(hbmp != 0, "failed to create bitmap\n"); - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - ret = GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS); - ok(ret == 1, "%d\n", ret); - ok(pbi->bmiHeader.biWidth == 13, "pbi->bmiHeader.biWidth = %ld\n", pbi->bmiHeader.biWidth); - ok(pbi->bmiHeader.biHeight == 7, "pbi->bmiHeader.biHeight = %ld\n", pbi->bmiHeader.biHeight); - ok(pbi->bmiHeader.biBitCount == 1, "pbi->bmiHeader.biBitCount = %d\n", pbi->bmiHeader.biBitCount); - ok(pbi->bmiHeader.biSizeImage == 28, "pbi->bmiHeader.biSizeImage = %ld\n", pbi->bmiHeader.biSizeImage); - - /* Test a mono bitmap with values set */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbi->bmiHeader.biWidth = 12; - pbi->bmiHeader.biHeight = 9; - pbi->bmiHeader.biPlanes = 1; - pbi->bmiHeader.biBitCount = 32; - pbi->bmiHeader.biCompression = BI_RGB; - pbi->bmiHeader.biSizeImage = 123; - ret = GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS); - ok(ret == 1, "%d\n", ret); - ok(pbi->bmiHeader.biWidth == 12, "pbi->bmiHeader.biWidth = %ld\n", pbi->bmiHeader.biWidth); - ok(pbi->bmiHeader.biHeight == 9, "pbi->bmiHeader.biHeight = %ld\n", pbi->bmiHeader.biHeight); - ok(pbi->bmiHeader.biBitCount == 32, "pbi->bmiHeader.biBitCount = %d\n", pbi->bmiHeader.biBitCount); - ok(pbi->bmiHeader.biSizeImage == 432, "pbi->bmiHeader.biSizeImage = %ld\n", pbi->bmiHeader.biSizeImage); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biWidth, 13); + ok_int(pbi->bmiHeader.biHeight, 7); + ok_int(pbi->bmiHeader.biBitCount, 1); + ok_int(pbi->bmiHeader.biSizeImage, 28); + + /* Test with values set, except biSizeImage */ + pbi->bmiHeader.biSizeImage = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biSizeImage, 28); + + /* Test with different biWidth set */ + pbi->bmiHeader.biWidth = 17; + pbi->bmiHeader.biHeight = 3; + pbi->bmiHeader.biSizeImage = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biSizeImage, 12); + ok_int(pbi->bmiHeader.biWidth, 17); + ok_int(pbi->bmiHeader.biHeight, 3); + + /* Test with different biBitCount set */ + pbi->bmiHeader.biBitCount = 4; + pbi->bmiHeader.biSizeImage = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biSizeImage, 36); + ok_int(pbi->bmiHeader.biBitCount, 4); + + /* Set bitmap dimensions */ + ok_int(SetBitmapDimensionEx(hbmp, 110, 220, NULL), 1); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biXPelsPerMeter, 0); + ok_int(pbi->bmiHeader.biYPelsPerMeter, 0); /* Set individual values */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); - pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbi->bmiHeader.biWidth = 12; - ret = GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS); - ok(ret == 1, "%d\n", ret); - pbi->bmiHeader.biWidth = 0; - pbi->bmiHeader.biSizeImage = 123; - ret = GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS); - ok(ret == 0, "%d\n", ret); - pbi->bmiHeader.biSizeImage = 0; - pbi->bmiHeader.biCompression = BI_RGB; - ret = GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS); - ok(ret == 0, "%d\n", ret); - - DeleteObject(hbmp); - DeleteDC(hdcMem); - ReleaseDC(NULL, hdcScreen); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biWidth = 12; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biWidth, 13); + ok_int(pbi->bmiHeader.biSizeImage, 28); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biSizeImage = 123; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biCompression = BI_RGB; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + + /* Set only biBitCount */ + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biBitCount = 5; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biBitCount = 1; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biBitCount = 8; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biBitCount = 32; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + ok_int(pbi->bmiHeader.biWidth, 0); + ok_int(pbi->bmiHeader.biHeight, 0); + ok_int(pbi->bmiHeader.biPlanes, 0); + ok_int(pbi->bmiHeader.biBitCount, 32); + ok_int(pbi->bmiHeader.biCompression, 0); + ok_int(pbi->bmiHeader.biSizeImage, 0); + + /* Get the bitmap bits */ + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biWidth = 4; + pbi->bmiHeader.biHeight = 4; + pbi->bmiHeader.biPlanes = 1; + pbi->bmiHeader.biBitCount = 32; + pbi->bmiHeader.biCompression = BI_RGB; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + pbi->bmiHeader.biWidth = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biWidth = -3; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biWidth = 4; + pbi->bmiHeader.biHeight = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biHeight = -4; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + pbi->bmiHeader.biBitCount = 31; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biBitCount = 16; + pbi->bmiHeader.biPlanes = 23; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biPlanes, 1); + pbi->bmiHeader.biCompression = BI_JPEG; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + pbi->bmiHeader.biCompression = BI_PNG; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); + + + /* Get the bitmap bits */ + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biWidth = 4; + pbi->bmiHeader.biHeight = 4; + pbi->bmiHeader.biPlanes = 1; + pbi->bmiHeader.biBitCount = 32; + pbi->bmiHeader.biCompression = BI_RGB; + pbi->bmiHeader.biSizeImage = 0; + pbi->bmiHeader.biXPelsPerMeter = 0; + pbi->bmiHeader.biYPelsPerMeter = 0; + pbi->bmiHeader.biClrUsed = 0; + pbi->bmiHeader.biClrImportant = 0; + cjSizeImage = ((pbi->bmiHeader.biWidth * pbi->bmiHeader.biBitCount + 31) / 32) * 4 * pbi->bmiHeader.biHeight; + pvBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 512); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 4); + + /* Set biBitCount to 0 */ + pbi->bmiHeader.biBitCount = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 0); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(GetDIBits(NULL, hbmp, 0, 4, NULL, pbi, DIB_RGB_COLORS), 0); + + /* Try different biBitCount and biWidth */ + pbi->bmiHeader.biBitCount = 24; + pbi->bmiHeader.biWidth = 3; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 4); + + /* Try different biBitCount and biWidth */ + pbi->bmiHeader.biBitCount = 24; + pbi->bmiHeader.biWidth = 3; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 4); + + /* Set only biBitCount and pjInit */ + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbi->bmiHeader.biBitCount = 5; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 0); + + DeleteObject(hbmp); + HeapFree(GetProcessHeap(), 0, pvBits); + + /* Test a 4 bpp bitmap */ + hbmp = CreateBitmap(3, 5, 1, 4, NULL); + ok(hbmp != 0, "failed to create bitmap\n"); + ZeroMemory(pbi, sizeof(BITMAPINFO)); + pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); + ok_int(pbi->bmiHeader.biWidth, 3); + ok_int(pbi->bmiHeader.biHeight, 5); + ok_int(pbi->bmiHeader.biBitCount, 4); + ok_int(pbi->bmiHeader.biSizeImage, 20); + + /* This does NOT work with incompatible bitmaps */ + pbi->bmiHeader.biSizeImage = 0; + ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 0); + + cjSizeImage = ((pbi->bmiHeader.biWidth * pbi->bmiHeader.biBitCount + 31) / 32) * 4 * pbi->bmiHeader.biHeight; + pvBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cjSizeImage); + + ok(SelectObject(hdcMem, ghbmpDIB4) != 0, "\n");; + ok_int(GetDIBits(hdcMem, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 0); + ok_int(GetDIBits(hdcMem, ghbmpDIB4, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 3); + + + DeleteDC(hdcMem); + ReleaseDC(NULL, hdcScreen); +} + +void Test_GetDIBits_BI_BITFIELDS() +{ } START_TEST(GetDIBits) { + //getchar(); + InitStuff(); + Test_GetDIBits_xBpp(1); + Test_GetDIBits_xBpp(4); + Test_GetDIBits_xBpp(8); + Test_GetDIBits_xBpp(16); + Test_GetDIBits_xBpp(24); + Test_GetDIBits_xBpp(32); Test_GetDIBits(); } Modified: trunk/rostests/apitests/gdi32/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/init.c?rev…
============================================================================== --- trunk/rostests/apitests/gdi32/init.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/init.c [iso-8859-1] Thu May 17 18:56:00 2012 @@ -5,6 +5,9 @@ HBITMAP ghbmpDIB32; HDC ghdcDIB32; PULONG pulDIB32Bits; +HBITMAP ghbmpDIB4; +HDC ghdcDIB4; +PULONG pulDIB4Bits; HPALETTE ghpal; struct @@ -31,10 +34,16 @@ { BITMAPINFO bmi32 = {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 32, BI_RGB, 0, 1, 1, 0, 0}}; + BITMAPINFO bmi4 = + {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 4, BI_RGB, 0, 1, 1, 0, 0}}; ghdcDIB32 = CreateCompatibleDC(0); + ghdcDIB4 = CreateCompatibleDC(0); ghbmpDIB32 = CreateDIBSection(ghdcDIB32, &bmi32, DIB_PAL_COLORS, (PVOID*)&pulDIB32Bits, 0, 0 ); + if (!ghbmpDIB32) return FALSE; + + ghbmpDIB4 = CreateDIBSection(ghdcDIB4, &bmi4, DIB_PAL_COLORS, (PVOID*)&pulDIB4Bits, 0, 0 ); if (!ghbmpDIB32) return FALSE; SelectObject(ghdcDIB32, ghbmpDIB32); Modified: trunk/rostests/apitests/gdi32/init.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/init.h?rev…
============================================================================== --- trunk/rostests/apitests/gdi32/init.h [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/init.h [iso-8859-1] Thu May 17 18:56:00 2012 @@ -2,6 +2,9 @@ extern HBITMAP ghbmpDIB32; extern HDC ghdcDIB32; extern PULONG pulDIB32Bits; +extern HBITMAP ghbmpDIB4; +extern HDC ghdcDIB4; +extern PULONG pulDIB4Bits; extern HPALETTE ghpal; extern struct {
12 years, 7 months
1
0
0
0
[tkreuzer] 56605: [GDI32_APITEST] More tests for CreateBitmap by Victor Martinez
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu May 17 18:51:47 2012 New Revision: 56605 URL:
http://svn.reactos.org/svn/reactos?rev=56605&view=rev
Log: [GDI32_APITEST] More tests for CreateBitmap by Victor Martinez Modified: trunk/rostests/apitests/gdi32/CreateBitmap.c Modified: trunk/rostests/apitests/gdi32/CreateBitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CreateBitm…
============================================================================== --- trunk/rostests/apitests/gdi32/CreateBitmap.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CreateBitmap.c [iso-8859-1] Thu May 17 18:51:47 2012 @@ -59,6 +59,7 @@ hbmp = CreateBitmap(0x7FFFFFF, 1, 1, 1, NULL); ok(hbmp != 0, "\n"); DeleteObject(hbmp); + SetLastError(0); hbmp = CreateBitmap(0x8000000, 1, 1, 1, NULL); ok(hbmp == 0, "\n"); @@ -68,6 +69,7 @@ hbmp = CreateBitmap(1, 0x1FFFFF00, 1, 1, NULL); //ok(hbmp != 0, "\n"); // fails on windows 2003 DeleteObject(hbmp); + SetLastError(0); hbmp = CreateBitmap(1, 0x1FFFFFFF, 1, 1, NULL); ok(hbmp == 0, "\n"); @@ -77,6 +79,7 @@ hbmp = CreateBitmap(0x20000, 0x1FFFF, 1, 1, NULL); //ok(hbmp != 0, "\n"); // fails on windows 2003 DeleteObject(hbmp); + SetLastError(0); hbmp = CreateBitmap(0x20000, 0x20000, 1, 1, NULL); ok(hbmp == 0, "\n"); @@ -94,41 +97,72 @@ { HBITMAP hbmp; BITMAP bitmap; - int result; + ULONG cjWidthBytes, cBitsPixel, cExpectedBitsPixel; hbmp = CreateBitmap(0, 0, 0, 0, NULL); ok(hbmp != 0, "should get a 1x1 bitmap\n"); ok(hbmp == GetStockObject(DEFAULT_BITMAP), "\n"); - result = GetObject(hbmp, sizeof(bitmap), &bitmap); - ok(result > 0, "result = %d\n", result); - ok(bitmap.bmType == 0, "bmType = %ld\n", bitmap.bmType); - ok(bitmap.bmWidth == 1, "bmWidth = %ld\n", bitmap.bmWidth); - ok(bitmap.bmHeight == 1, "bmHeight = %ld\n", bitmap.bmHeight); - ok(bitmap.bmWidthBytes == 2, "bmWidthBytes = %ld\n", bitmap.bmWidthBytes); - ok(bitmap.bmPlanes == 1, "bmPlanes = %d\n", bitmap.bmPlanes); - ok(bitmap.bmBitsPixel == 1, "bmBitsPixel = %d\n", bitmap.bmBitsPixel); - ok(bitmap.bmBits == 0, "bmBits = %p\n", bitmap.bmBits); + ok_int(GetObject(hbmp, sizeof(bitmap), &bitmap), sizeof(BITMAP)); + ok_int(bitmap.bmType, 0); + ok_int(bitmap.bmWidth, 1); + ok_int(bitmap.bmHeight, 1); + ok_int(bitmap.bmWidthBytes, 2); + ok_int(bitmap.bmPlanes, 1); + ok_int(bitmap.bmBitsPixel, 1); + ok_ptr(bitmap.bmBits, 0); DeleteObject(hbmp); hbmp = CreateBitmap(1, 2, 1, 1, NULL); ok(hbmp != 0, "should get a 1x2 bitmap\n"); - result = GetObject(hbmp, sizeof(bitmap), &bitmap); - ok(result > 0, "result = %d\n", result); - ok(bitmap.bmType == 0, "bmType = %ld\n", bitmap.bmType); - ok(bitmap.bmWidth == 1, "bmWidth = %ld\n", bitmap.bmWidth); - ok(bitmap.bmHeight == 2, "bmHeight = %ld\n", bitmap.bmHeight); - ok(bitmap.bmWidthBytes == 2, "bmWidthBytes = %ld\n", bitmap.bmWidthBytes); - ok(bitmap.bmPlanes == 1, "bmPlanes = %d\n", bitmap.bmPlanes); - ok(bitmap.bmBitsPixel == 1, "bmBitsPixel = %d\n", bitmap.bmBitsPixel); - ok(bitmap.bmBits == 0, "bmBits = %p\n", bitmap.bmBits); + ok_int(GetObject(hbmp, sizeof(bitmap), &bitmap), sizeof(BITMAP)); + ok_int(bitmap.bmType, 0); + ok_int(bitmap.bmWidth, 1); + ok_int(bitmap.bmHeight, 2); + ok_int(bitmap.bmWidthBytes, 2); + ok_int(bitmap.bmPlanes, 1); + ok_int(bitmap.bmBitsPixel, 1); + ok_ptr(bitmap.bmBits, 0); DeleteObject(hbmp); + + for (cBitsPixel = 0; cBitsPixel <= 32; cBitsPixel++) + { + /* CreateBitmap API accepts any number as BitsPixels param. + but it just can create 1, 4, 8, 16, 24, 32 bpp Bitmaps */ + if (cBitsPixel <= 1) cExpectedBitsPixel = 1; + else if (cBitsPixel <= 4) cExpectedBitsPixel = 4; + else if (cBitsPixel <= 8) cExpectedBitsPixel = 8; + else if (cBitsPixel <= 16) cExpectedBitsPixel = 16; + else if (cBitsPixel <= 24) cExpectedBitsPixel = 24; + else if (cBitsPixel <= 32) cExpectedBitsPixel = 32; + + hbmp = CreateBitmap(1, 2, 1, cBitsPixel, NULL); + ok(hbmp != 0, "should get a 1x2 bitmap %ld\n", cBitsPixel); + ok_int(GetObject(hbmp, sizeof(bitmap), &bitmap), sizeof(BITMAP)); + + /* calculate expected line width */ + cjWidthBytes = ((((ULONG)bitmap.bmWidth) * ((ULONG)bitmap.bmBitsPixel) + 15) & ~15) >> 3; + + ok_int(bitmap.bmType, 0); + ok_int(bitmap.bmWidth, 1); + ok_int(bitmap.bmHeight, 2); + ok_int(bitmap.bmPlanes, 1); + ok_int(bitmap.bmBitsPixel, cExpectedBitsPixel); + ok_int(bitmap.bmWidthBytes, cjWidthBytes); + ok_ptr(bitmap.bmBits, 0); + DeleteObject(hbmp); + + } + + hbmp = CreateBitmap(1, 2, 1, 33, NULL); + ok(hbmp == 0, "Expected failure for 33 bpp\n"); + } START_TEST(CreateBitmap) { - Test_CreateBitmap_Params(); + //Test_CreateBitmap_Params(); Test_CreateBitmap(); + } -
12 years, 7 months
1
0
0
0
[jimtabor] 56604: - [User32] Patch by Dmitry Timoshkov : IsDialogMessage should allow control ids other than IDOK when processing WM_KEYDOWN.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu May 17 17:54:09 2012 New Revision: 56604 URL:
http://svn.reactos.org/svn/reactos?rev=56604&view=rev
Log: - [User32] Patch by Dmitry Timoshkov : IsDialogMessage should allow control ids other than IDOK when processing WM_KEYDOWN. Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Thu May 17 17:54:09 2012 @@ -2561,7 +2561,7 @@ else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0))) { HWND hwndDef = DIALOG_IdToHwnd(hDlg, LOWORD(dw)); - if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK) + if (!hwndDef || IsWindowEnabled(hwndDef)) SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef); } else
12 years, 7 months
1
0
0
0
[akhaldi] 56603: [RICHED20_WINETEST] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu May 17 16:52:25 2012 New Revision: 56603 URL:
http://svn.reactos.org/svn/reactos?rev=56603&view=rev
Log: [RICHED20_WINETEST] * Sync to Wine 1.5.4. Modified: trunk/rostests/winetests/riched20/editor.c trunk/rostests/winetests/riched20/txtsrv.c Modified: trunk/rostests/winetests/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/editor…
============================================================================== --- trunk/rostests/winetests/riched20/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/editor.c [iso-8859-1] Thu May 17 16:52:25 2012 @@ -6366,7 +6366,7 @@ /* Reset to default rect and check how the format rect adjusts to window * resize and how it copes with very small windows */ - SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)NULL); + SendMessageA(hwnd, EM_SETRECT, 0, 0); MoveWindow(hwnd, 0, 0, 100, 30, FALSE); GetClientRect(hwnd, &clientRect); @@ -7170,6 +7170,114 @@ delimiter_tests[i].c, delimiter_tests[i].isdelimiter, result); } DestroyWindow(hwndRichEdit); +} + +/* + * This test attempts to show the effect of enter on a richedit + * control v1.0 inserts CRLF whereas for higher versions it only + * inserts CR. If shows that EM_GETTEXTEX with GT_USECRLF == WM_GETTEXT + * and also shows that GT_USECRLF has no effect in richedit 1.0, but + * does for higher. The same test is cloned in riched32 and riched20. + */ +static void test_enter(void) +{ + static const struct { + const char *initialtext; + const int cursor; + const char *expectedwmtext; + const char *expectedemtext; + const char *expectedemtextcrlf; + } testenteritems[] = { + { "aaabbb\r\n", 3, "aaa\r\nbbb\r\n", "aaa\rbbb\r", "aaa\r\nbbb\r\n"}, + { "aaabbb\r\n", 6, "aaabbb\r\n\r\n", "aaabbb\r\r", "aaabbb\r\n\r\n"}, + { "aa\rabbb\r\n", 7, "aa\r\nabbb\r\n\r\n", "aa\rabbb\r\r", "aa\r\nabbb\r\n\r\n"}, + { "aa\rabbb\r\n", 3, "aa\r\n\r\nabbb\r\n", "aa\r\rabbb\r", "aa\r\n\r\nabbb\r\n"}, + { "aa\rabbb\r\n", 2, "aa\r\n\r\nabbb\r\n", "aa\r\rabbb\r", "aa\r\n\r\nabbb\r\n"} + }; + + char expectedbuf[1024]; + char resultbuf[1024]; + HWND hwndRichEdit = new_richedit(NULL); + UINT i,j; + + for (i = 0; i < sizeof(testenteritems)/sizeof(testenteritems[0]); i++) { + + char buf[1024] = {0}; + LRESULT result; + GETTEXTEX getText; + const char *expected; + + /* Set the text to the initial text */ + result = SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) testenteritems[i].initialtext); + ok (result == 1, "[%d] WM_SETTEXT returned %ld instead of 1\n", i, result); + + /* Send Enter */ + SendMessage(hwndRichEdit, EM_SETSEL, testenteritems[i].cursor, testenteritems[i].cursor); + simulate_typing_characters(hwndRichEdit, "\r"); + + /* 1. Retrieve with WM_GETTEXT */ + buf[0] = 0x00; + result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buf); + expected = testenteritems[i].expectedwmtext; + + resultbuf[0]=0x00; + for (j = 0; j < (UINT)result; j++) + sprintf(resultbuf+strlen(resultbuf), "%02x", buf[j] & 0xFF); + expectedbuf[0] = '\0'; + for (j = 0; j < strlen(expected); j++) + sprintf(expectedbuf+strlen(expectedbuf), "%02x", expected[j] & 0xFF); + + result = strcmp(expected, buf); + ok (result == 0, + "[%d] WM_GETTEXT unexpected '%s' expected '%s'\n", + i, resultbuf, expectedbuf); + + /* 2. Retrieve with EM_GETTEXTEX, GT_DEFAULT */ + getText.cb = sizeof(buf); + getText.flags = GT_DEFAULT; + getText.codepage = CP_ACP; + getText.lpDefaultChar = NULL; + getText.lpUsedDefChar = NULL; + buf[0] = 0x00; + result = SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); + expected = testenteritems[i].expectedemtext; + + resultbuf[0]=0x00; + for (j = 0; j < (UINT)result; j++) + sprintf(resultbuf+strlen(resultbuf), "%02x", buf[j] & 0xFF); + expectedbuf[0] = '\0'; + for (j = 0; j < strlen(expected); j++) + sprintf(expectedbuf+strlen(expectedbuf), "%02x", expected[j] & 0xFF); + + result = strcmp(expected, buf); + ok (result == 0, + "[%d] EM_GETTEXTEX, GT_DEFAULT unexpected '%s', expected '%s'\n", + i, resultbuf, expectedbuf); + + /* 3. Retrieve with EM_GETTEXTEX, GT_USECRLF */ + getText.cb = sizeof(buf); + getText.flags = GT_USECRLF; + getText.codepage = CP_ACP; + getText.lpDefaultChar = NULL; + getText.lpUsedDefChar = NULL; + buf[0] = 0x00; + result = SendMessage(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM) buf); + expected = testenteritems[i].expectedemtextcrlf; + + resultbuf[0]=0x00; + for (j = 0; j < (UINT)result; j++) + sprintf(resultbuf+strlen(resultbuf), "%02x", buf[j] & 0xFF); + expectedbuf[0] = '\0'; + for (j = 0; j < strlen(expected); j++) + sprintf(expectedbuf+strlen(expectedbuf), "%02x", expected[j] & 0xFF); + + result = strcmp(expected, buf); + ok (result == 0, + "[%d] EM_GETTEXTEX, GT_USECRLF unexpected '%s', expected '%s'\n", + i, resultbuf, expectedbuf); + } + + DestroyWindow(hwndRichEdit); } START_TEST( editor ) @@ -7230,6 +7338,7 @@ test_dialogmode(); test_EM_FINDWORDBREAK_W(); test_EM_FINDWORDBREAK_A(); + test_enter(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. Modified: trunk/rostests/winetests/riched20/txtsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/txtsrv…
============================================================================== --- trunk/rostests/winetests/riched20/txtsrv.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/txtsrv.c [iso-8859-1] Thu May 17 16:52:25 2012 @@ -21,6 +21,7 @@ */ #define COBJMACROS +#define CONST_VTABLE #include <stdio.h> #include <stdarg.h> @@ -38,6 +39,7 @@ static IID *pIID_ITextServices; static IID *pIID_ITextHost; static IID *pIID_ITextHost2; +static PCreateTextServices pCreateTextServices; static const char *debugstr_guid(REFIID riid) { @@ -620,7 +622,6 @@ { IUnknown *init; HRESULT result; - PCreateTextServices pCreateTextServices; dummyTextHost = CoTaskMemAlloc(sizeof(*dummyTextHost)); if (dummyTextHost == NULL) { @@ -633,7 +634,6 @@ /* MSDN states that an IUnknown object is returned by CreateTextServices which is then queried to obtain a ITextServices object. */ - pCreateTextServices = (void*)GetProcAddress(hmoduleRichEdit, "CreateTextServices"); result = (*pCreateTextServices)(NULL, &dummyTextHost->ITextHost_iface, &init); ok(result == S_OK, "Did not return S_OK when created (result = %x)\n", result); if (result != S_OK) { @@ -812,6 +812,69 @@ "unexpected value for IID_ITextHost2: %s\n", debugstr_guid(pIID_ITextHost2)); } +/* Outer IUnknown for COM aggregation tests */ +struct unk_impl { + IUnknown IUnknown_iface; + LONG ref; + IUnknown *inner_unk; +}; + +static inline struct unk_impl *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct unk_impl, IUnknown_iface); +} + +static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + + return IUnknown_QueryInterface(This->inner_unk, riid, ppv); +} + +static ULONG WINAPI unk_AddRef(IUnknown *iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + + return InterlockedIncrement(&This->ref); +} + +static ULONG WINAPI unk_Release(IUnknown *iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + + return InterlockedDecrement(&This->ref); +} + +static const IUnknownVtbl unk_vtbl = +{ + unk_QueryInterface, + unk_AddRef, + unk_Release +}; + +static void test_COM(void) +{ + struct unk_impl unk_obj = {{&unk_vtbl}, 19, NULL}; + struct ITextHostTestImpl texthost = {{&itextHostVtbl}, 1}; + ITextServices *textsrv; + ULONG refcount; + HRESULT hr; + + /* COM aggregation */ + hr = pCreateTextServices(&unk_obj.IUnknown_iface, &texthost.ITextHost_iface, + &unk_obj.inner_unk); + ok(hr == S_OK, "CreateTextServices failed: %08x\n", hr); + hr = IUnknown_QueryInterface(unk_obj.inner_unk, pIID_ITextServices, (void**)&textsrv); + ok(hr == S_OK, "QueryInterface for IID_ITextServices failed: %08x\n", hr); + refcount = ITextServices_AddRef(textsrv); + ok(refcount == unk_obj.ref, "CreateTextServices just pretends to support COM aggregation\n"); + refcount = ITextServices_Release(textsrv); + ok(refcount == unk_obj.ref, "CreateTextServices just pretends to support COM aggregation\n"); + refcount = ITextServices_Release(textsrv); + ok(refcount == 19, "Refcount should be back at 19 but is %u\n", refcount); + + IUnknown_Release(unk_obj.inner_unk); +} START_TEST( txtsrv ) { @@ -825,7 +888,10 @@ pIID_ITextServices = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextServices"); pIID_ITextHost = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextHost"); pIID_ITextHost2 = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextHost2"); + pCreateTextServices = (void*)GetProcAddress(hmoduleRichEdit, "CreateTextServices"); + test_IIDs(); + test_COM(); if (init_texthost()) {
12 years, 7 months
1
0
0
0
[akhaldi] 56602: [RICHED20] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu May 17 16:52:17 2012 New Revision: 56602 URL:
http://svn.reactos.org/svn/reactos?rev=56602&view=rev
Log: [RICHED20] * Sync to Wine 1.5.4. Modified: trunk/reactos/dll/win32/riched20/CMakeLists.txt trunk/reactos/dll/win32/riched20/caret.c trunk/reactos/dll/win32/riched20/editor.c trunk/reactos/dll/win32/riched20/editor.h trunk/reactos/dll/win32/riched20/paint.c trunk/reactos/dll/win32/riched20/richole.c trunk/reactos/dll/win32/riched20/txtsrv.c trunk/reactos/dll/win32/riched20/wrap.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/riched20/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/riched20/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/CMakeLists.txt [iso-8859-1] Thu May 17 16:52:17 2012 @@ -3,8 +3,6 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(riched20.dll riched20.spec ADD_IMPORTLIB) - -set_rc_compiler() list(APPEND SOURCE caret.c @@ -51,5 +49,4 @@ ntdll) add_pch(riched20 editor.h) - add_cd_file(TARGET riched20 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/riched20/caret.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/caret.c…
============================================================================== --- trunk/reactos/dll/win32/riched20/caret.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/caret.c [iso-8859-1] Thu May 17 16:52:17 2012 @@ -146,8 +146,11 @@ { int start, end; ME_GetSelectionOfs(editor, &start, &end); - editor->pCursors[1] = editor->pCursors[0]; - ME_Repaint(editor); + if (start != end) + { + editor->pCursors[1] = editor->pCursors[0]; + ME_Repaint(editor); + } ME_ClearTempStyle(editor); return end; } Modified: trunk/reactos/dll/win32/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.…
============================================================================== --- trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] Thu May 17 16:52:17 2012 @@ -2180,6 +2180,7 @@ ME_DisplayItem *para = cursor.pPara; int from, to; const WCHAR endl = '\r'; + const WCHAR endlv10[] = {'\r','\n'}; ME_Style *style; if (editor->styleFlags & ES_READONLY) { @@ -2282,7 +2283,10 @@ if (shift_is_down) ME_InsertEndRowFromCursor(editor, 0); else - ME_InsertTextFromCursor(editor, 0, &endl, 1, style); + if (!editor->bEmulateVersion10) + ME_InsertTextFromCursor(editor, 0, &endl, 1, style); + else + ME_InsertTextFromCursor(editor, 0, endlv10, 2, style); ME_ReleaseStyle(style); ME_CommitCoalescingUndo(editor); SetCursor(NULL); @@ -4459,7 +4463,7 @@ ps.rcPaint.right = editor->rcFormat.right; } - ME_PaintContent(editor, hDC, FALSE, &ps.rcPaint); + ME_PaintContent(editor, hDC, &ps.rcPaint); EndPaint(editor->hWnd, &ps); return 0; } Modified: trunk/reactos/dll/win32/riched20/editor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.…
============================================================================== --- trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] Thu May 17 16:52:17 2012 @@ -187,7 +187,7 @@ /* wrap.c */ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN; -void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN; +void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor, ME_DisplayItem *start_para, ME_DisplayItem *end_para) DECLSPEC_HIDDEN; void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN; /* para.c */ @@ -207,7 +207,7 @@ void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN; /* paint.c */ -void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate) DECLSPEC_HIDDEN; +void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate) DECLSPEC_HIDDEN; void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_RewrapRepaint(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/riched20/paint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/paint.c…
============================================================================== --- trunk/reactos/dll/win32/riched20/paint.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/paint.c [iso-8859-1] Thu May 17 16:52:17 2012 @@ -25,7 +25,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph); -void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate) +void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate) { ME_DisplayItem *item; ME_Context c; @@ -71,18 +71,9 @@ ys -= item->member.para.pCell->member.cell.yTextOffset; } - if (!bOnlyNew || (item->member.para.nFlags & MEPF_REPAINT)) - { - /* Draw the paragraph if any of the paragraph is in the update region. */ - if (ys < rcUpdate->bottom && ye > rcUpdate->top) - { - ME_DrawParagraph(&c, item); - /* Clear the repaint flag if the whole paragraph is in the - * update region. */ - if (rcUpdate->top <= ys && rcUpdate->bottom >= ye) - item->member.para.nFlags &= ~MEPF_REPAINT; - } - } + /* Draw the paragraph if any of the paragraph is in the update region. */ + if (ys < rcUpdate->bottom && ye > rcUpdate->top) + ME_DrawParagraph(&c, item); item = item->member.para.next_para; } if (c.pt.y + editor->nTotalLength < c.rcView.bottom) @@ -93,15 +84,6 @@ rc.left = c.rcView.left; rc.bottom = c.rcView.bottom; rc.right = c.rcView.right; - - if (bOnlyNew) - { - /* Only erase region drawn from previous call to ME_PaintContent */ - if (editor->nTotalLength < editor->nLastTotalLength) - rc.bottom = c.pt.y + editor->nLastTotalLength; - else - SetRectEmpty(&rc); - } IntersectRect(&rc, &rc, rcUpdate); @@ -316,7 +298,7 @@ hPen = CreatePen(PS_DOT, 1, rgb); break; default: - WINE_FIXME("Unknown underline type (%u)\n", s->fmt.bUnderlineType); + FIXME("Unknown underline type (%u)\n", s->fmt.bUnderlineType); /* fall through */ case CFU_CF1UNDERLINE: /* this type is supported in the font, do nothing */ case CFU_UNDERLINENONE: @@ -1275,7 +1257,8 @@ void ME_InvalidateSelection(ME_TextEditor *editor) { - ME_DisplayItem *para1, *para2; + ME_DisplayItem *sel_start, *sel_end; + ME_DisplayItem *repaint_start = NULL, *repaint_end = NULL; int nStart, nEnd; int len = ME_GetTextLength(editor); @@ -1285,32 +1268,39 @@ if (nStart == nEnd && editor->nLastSelStart == editor->nLastSelEnd) return; ME_WrapMarkedParagraphs(editor); - ME_GetSelectionParas(editor, ¶1, ¶2); - assert(para1->type == diParagraph); - assert(para2->type == diParagraph); + ME_GetSelectionParas(editor, &sel_start, &sel_end); + assert(sel_start->type == diParagraph); + assert(sel_end->type == diParagraph); /* last selection markers aren't always updated, which means * they can point past the end of the document */ if (editor->nLastSelStart > len || editor->nLastSelEnd > len) { - ME_MarkForPainting(editor, - ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph), - editor->pBuffer->pLast); + repaint_start = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph); + repaint_end = editor->pBuffer->pLast; + ME_MarkForPainting(editor, repaint_start, repaint_end); } else { /* if the start part of selection is being expanded or contracted... */ if (nStart < editor->nLastSelStart) { - ME_MarkForPainting(editor, para1, editor->pLastSelStartPara->member.para.next_para); + repaint_start = sel_start; + repaint_end = editor->pLastSelStartPara->member.para.next_para; } else if (nStart > editor->nLastSelStart) { - ME_MarkForPainting(editor, editor->pLastSelStartPara, para1->member.para.next_para); - } + repaint_start = editor->pLastSelStartPara; + repaint_end = sel_start->member.para.next_para; + } + ME_MarkForPainting(editor, repaint_start, repaint_end); /* if the end part of selection is being contracted or expanded... */ if (nEnd < editor->nLastSelEnd) { - ME_MarkForPainting(editor, para2, editor->pLastSelEndPara->member.para.next_para); + if (!repaint_start) repaint_start = sel_end; + repaint_end = editor->pLastSelEndPara->member.para.next_para; + ME_MarkForPainting(editor, sel_end, repaint_end); } else if (nEnd > editor->nLastSelEnd) { - ME_MarkForPainting(editor, editor->pLastSelEndPara, para2->member.para.next_para); - } - } - - ME_InvalidateMarkedParagraphs(editor); + if (!repaint_start) repaint_start = editor->pLastSelEndPara; + repaint_end = sel_end->member.para.next_para; + ME_MarkForPainting(editor, editor->pLastSelEndPara, repaint_end); + } + } + + ME_InvalidateMarkedParagraphs(editor, repaint_start, repaint_end); /* remember the last invalidated position */ ME_GetSelectionOfs(editor, &editor->nLastSelStart, &editor->nLastSelEnd); ME_GetSelectionParas(editor, &editor->pLastSelStartPara, &editor->pLastSelEndPara); Modified: trunk/reactos/dll/win32/riched20/richole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/richole…
============================================================================== --- trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] Thu May 17 16:52:17 2012 @@ -1669,6 +1669,7 @@ hMemDC, 0, 0, dibsect.dsBm.bmWidth, dibsect.dsBm.bmHeight, SRCCOPY); } + DeleteDC(hMemDC); if (!stgm.pUnkForRelease) DeleteObject(stgm.u.hBitmap); break; case TYMED_ENHMF: Modified: trunk/reactos/dll/win32/riched20/txtsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/txtsrv.…
============================================================================== --- trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] Thu May 17 16:52:17 2012 @@ -54,96 +54,57 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); typedef struct ITextServicesImpl { + IUnknown IUnknown_inner; ITextServices ITextServices_iface; + IUnknown *outer_unk; + LONG ref; ITextHost *pMyHost; - LONG ref; CRITICAL_SECTION csTxtSrv; ME_TextEditor *editor; char spare[256]; } ITextServicesImpl; -static const ITextServicesVtbl textservices_Vtbl; - -/****************************************************************** - * CreateTextServices (RICHED20.4) - */ -HRESULT WINAPI CreateTextServices(IUnknown * pUnkOuter, - ITextHost * pITextHost, - IUnknown **ppUnk) -{ - ITextServicesImpl *ITextImpl; - HRESULT hres; - TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk); - if (pITextHost == NULL) - return E_POINTER; - - ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl)); - if (ITextImpl == NULL) - return E_OUTOFMEMORY; - InitializeCriticalSection(&ITextImpl->csTxtSrv); - ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv"); - ITextImpl->ref = 1; - ITextHost_AddRef(pITextHost); - ITextImpl->pMyHost = pITextHost; - ITextImpl->ITextServices_iface.lpVtbl = &textservices_Vtbl; - ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE); - ITextImpl->editor->exStyleFlags = 0; - ITextImpl->editor->rcFormat.left = 0; - ITextImpl->editor->rcFormat.top = 0; - ITextImpl->editor->rcFormat.right = 0; - ITextImpl->editor->rcFormat.bottom = 0; - - ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres); - - if (pUnkOuter) - { - FIXME("Support aggregation\n"); - return CLASS_E_NOAGGREGATION; +static inline ITextServicesImpl *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, ITextServicesImpl, IUnknown_inner); +} + +static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + ITextServicesImpl *This = impl_from_IUnknown(iface); + + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (IsEqualIID(riid, &IID_IUnknown)) + *ppv = &This->IUnknown_inner; + else if IsEqualIID(riid, &IID_ITextServices) + *ppv = &This->ITextServices_iface; + else { + *ppv = NULL; + FIXME("Unknown interface: %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; } - *ppUnk = (IUnknown *)&ITextImpl->ITextServices_iface; - return S_OK; -} - -static inline ITextServicesImpl *impl_from_ITextServices(ITextServices *iface) -{ - return CONTAINING_RECORD(iface, ITextServicesImpl, ITextServices_iface); -} - -static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID riid, void **ppv) -{ - ITextServicesImpl *This = impl_from_ITextServices(iface); - - TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv); - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextServices)) - *ppv = This; - - if (*ppv) - { - IUnknown_AddRef((IUnknown *)(*ppv)); - TRACE ("-- Interface = %p\n", *ppv); - return S_OK; - } - FIXME("Unknown interface: %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface) -{ - ITextServicesImpl *This = impl_from_ITextServices(iface); - DWORD ref = InterlockedIncrement(&This->ref); - - TRACE("(%p/%p)->() AddRef from %d\n", This, iface, ref - 1); + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI ITextServicesImpl_AddRef(IUnknown *iface) +{ + ITextServicesImpl *This = impl_from_IUnknown(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + return ref; } -static ULONG WINAPI fnTextSrv_Release(ITextServices *iface) -{ - ITextServicesImpl *This = impl_from_ITextServices(iface); - DWORD ref = InterlockedDecrement(&This->ref); - - TRACE("(%p/%p)->() Release from %d\n", This, iface, ref + 1); +static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface) +{ + ITextServicesImpl *This = impl_from_IUnknown(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); if (!ref) { @@ -153,6 +114,36 @@ CoTaskMemFree(This); } return ref; +} + +static const IUnknownVtbl textservices_inner_vtbl = +{ + ITextServicesImpl_QueryInterface, + ITextServicesImpl_AddRef, + ITextServicesImpl_Release +}; + +static inline ITextServicesImpl *impl_from_ITextServices(ITextServices *iface) +{ + return CONTAINING_RECORD(iface, ITextServicesImpl, ITextServices_iface); +} + +static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID riid, void **ppv) +{ + ITextServicesImpl *This = impl_from_ITextServices(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); +} + +static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface) +{ + ITextServicesImpl *This = impl_from_ITextServices(iface); + return IUnknown_AddRef(This->outer_unk); +} + +static ULONG WINAPI fnTextSrv_Release(ITextServices *iface) +{ + ITextServicesImpl *This = impl_from_ITextServices(iface); + return IUnknown_Release(This->outer_unk); } DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface, UINT msg, WPARAM wparam, @@ -370,7 +361,7 @@ DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxPropertyBitsChange,12) DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCachedSize,12) -static const ITextServicesVtbl textservices_Vtbl = +static const ITextServicesVtbl textservices_vtbl = { fnTextSrv_QueryInterface, fnTextSrv_AddRef, @@ -394,3 +385,42 @@ THISCALL(fnTextSrv_OnTxPropertyBitsChange), THISCALL(fnTextSrv_TxGetCachedSize) }; + +/****************************************************************** + * CreateTextServices (RICHED20.4) + */ +HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, IUnknown **ppUnk) +{ + ITextServicesImpl *ITextImpl; + HRESULT hres; + TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk); + if (pITextHost == NULL) + return E_POINTER; + + ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl)); + if (ITextImpl == NULL) + return E_OUTOFMEMORY; + InitializeCriticalSection(&ITextImpl->csTxtSrv); + ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv"); + ITextImpl->ref = 1; + ITextHost_AddRef(pITextHost); + ITextImpl->pMyHost = pITextHost; + ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; + ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; + ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE); + ITextImpl->editor->exStyleFlags = 0; + ITextImpl->editor->rcFormat.left = 0; + ITextImpl->editor->rcFormat.top = 0; + ITextImpl->editor->rcFormat.right = 0; + ITextImpl->editor->rcFormat.bottom = 0; + + ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres); + + if (pUnkOuter) + ITextImpl->outer_unk = pUnkOuter; + else + ITextImpl->outer_unk = &ITextImpl->IUnknown_inner; + + *ppUnk = &ITextImpl->IUnknown_inner; + return S_OK; +} Modified: trunk/reactos/dll/win32/riched20/wrap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/wrap.c?…
============================================================================== --- trunk/reactos/dll/win32/riched20/wrap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/wrap.c [iso-8859-1] Thu May 17 16:52:17 2012 @@ -583,12 +583,22 @@ tp->member.para.nRows = wc.nRow; } +static void ME_MarkRepaintEnd(ME_DisplayItem *para, + ME_DisplayItem **repaint_start, + ME_DisplayItem **repaint_end) +{ + if (!*repaint_start) + *repaint_start = para; + *repaint_end = para->member.para.next_para; + para->member.para.nFlags |= MEPF_REPAINT; +} + BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { ME_DisplayItem *item; ME_Context c; - BOOL bModified = FALSE; int totalWidth = 0; + ME_DisplayItem *repaint_start = NULL, *repaint_end = NULL; ME_InitContext(&c, editor, ITextHost_TxGetDC(editor->texthost)); c.pt.x = 0; @@ -605,9 +615,7 @@ ME_WrapTextParagraph(&c, item); if (bRedraw) - item->member.para.nFlags |= MEPF_REPAINT; - - bModified = bModified | bRedraw; + ME_MarkRepaintEnd(item, &repaint_start, &repaint_end); if (item->member.para.nFlags & MEPF_ROWSTART) { @@ -678,10 +686,10 @@ { /* The height of the cells has grown, so invalidate the bottom of * the cells. */ - item->member.para.nFlags |= MEPF_REPAINT; + ME_MarkRepaintEnd(item, &repaint_start, &repaint_end); cell = ME_FindItemBack(item, diCell); while (cell) { - ME_FindItemBack(cell, diParagraph)->member.para.nFlags |= MEPF_REPAINT; + ME_MarkRepaintEnd(ME_FindItemBack(cell, diParagraph), &repaint_start, &repaint_end); cell = cell->member.cell.prev_cell; } } @@ -729,12 +737,17 @@ ME_DestroyContext(&c); - if (bModified || editor->nTotalLength < editor->nLastTotalLength) - ME_InvalidateMarkedParagraphs(editor); - return bModified; -} - -void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) + if (repaint_start || editor->nTotalLength < editor->nLastTotalLength) + { + if (!repaint_start) repaint_start = editor->pBuffer->pFirst; + ME_InvalidateMarkedParagraphs(editor, repaint_start, repaint_end); + } + return !!repaint_start; +} + +void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor, + ME_DisplayItem *start_para, + ME_DisplayItem *end_para) { ME_Context c; RECT rc; @@ -745,14 +758,13 @@ rc = c.rcView; ofs = editor->vert_si.nPos; - item = editor->pBuffer->pFirst; - while(item != editor->pBuffer->pLast) { + item = start_para; + while(item && item != end_para) { if (item->member.para.nFlags & MEPF_REPAINT) { rc.top = c.rcView.top + item->member.para.pt.y - ofs; - rc.bottom = max(c.rcView.top + item->member.para.pt.y - + item->member.para.nHeight - ofs, - c.rcView.bottom); + rc.bottom = max(rc.top + item->member.para.nHeight, c.rcView.bottom); ITextHost_TxInvalidateRect(editor->texthost, &rc, TRUE); + item->member.para.nFlags &= ~MEPF_REPAINT; } item = item->member.para.next_para; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu May 17 16:52:17 2012 @@ -139,7 +139,7 @@ reactos/dll/win32/query # Synced to Wine-1.3.37 reactos/dll/win32/rasapi32 # Synced to Wine-1.3.37 reactos/dll/win32/resutils # Synced to Wine-1.3.37 -reactos/dll/win32/riched20 # Synced to Wine-1.3.37 +reactos/dll/win32/riched20 # Synced to Wine-1.5.4 reactos/dll/win32/riched32 # Synced to Wine-1.3.37 reactos/dll/win32/rpcrt4 # Synced to Wine-1.3.26 reactos/dll/win32/rsabase # Autosync
12 years, 7 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
23
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
Results per page:
10
25
50
100
200