winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
854 discussions
Start a n
N
ew thread
Robert Shearman : ole32: When CoLockObjectExternal with fLock= TRUE is used on an object
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: 628371021bddc7440724ed4b79e5fe4a9c335d1d URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=628371021bddc7440724ed4…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Fri Jun 30 11:07:43 2006 +0100 ole32: When CoLockObjectExternal with fLock=TRUE is used on an object that hasn't yet been marshaled then it should create a new stub manager. --- dlls/ole32/compobj.c | 16 ++++++++++++++++ dlls/ole32/tests/marshal.c | 20 +++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index fc65ddb..f66926c 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2098,6 +2098,10 @@ static void COM_RevokeAllClasses() * RETURNS * Success: S_OK. * Failure: HRESULT code. + * + * NOTES + * If fLock is TRUE and an object is passed in that doesn't have a stub + * manager then a new stub manager is created for the object. */ HRESULT WINAPI CoLockObjectExternal( LPUNKNOWN pUnk, @@ -2126,6 +2130,18 @@ HRESULT WINAPI CoLockObjectExternal( return S_OK; } + else if (fLock) + { + stubmgr = new_stub_manager(apt, pUnk); + + if (stubmgr) + { + stub_manager_ext_addref(stubmgr, 1); + stub_manager_int_release(stubmgr); + } + + return S_OK; + } else { WARN("stub object not found %p\n", pUnk); diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index 102be87..fc7c205 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -998,6 +998,20 @@ static void test_lock_object_external(vo cLocks = 0; + /* test the stub manager creation aspect of CoLockObjectExternal when the + * object hasn't been marshaled yet */ + CoLockObjectExternal((IUnknown*)&Test_ClassFactory, TRUE, TRUE); + + ok_more_than_one_lock(); + + CoDisconnectObject((IUnknown*)&Test_ClassFactory, 0); + + ok_no_locks(); + + /* test our empty stub manager being handled correctly in + * CoMarshalInterface */ + CoLockObjectExternal((IUnknown*)&Test_ClassFactory, TRUE, TRUE); + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); ok_ole_success(hr, CreateStreamOnHGlobal); hr = CoMarshalInterface(pStream, &IID_IClassFactory, (IUnknown*)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); @@ -1006,7 +1020,7 @@ static void test_lock_object_external(vo CoLockObjectExternal((IUnknown*)&Test_ClassFactory, TRUE, TRUE); ok_more_than_one_lock(); - + IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); hr = CoReleaseMarshalData(pStream); ok_ole_success(hr, CoReleaseMarshalData); @@ -1016,6 +1030,10 @@ static void test_lock_object_external(vo CoLockObjectExternal((IUnknown*)&Test_ClassFactory, FALSE, TRUE); + ok_more_than_one_lock(); + + CoLockObjectExternal((IUnknown*)&Test_ClassFactory, FALSE, TRUE); + ok_no_locks(); }
1
0
0
0
Robert Shearman : oleaut32: Fix a typo where the FIXME doesn' t match the code.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: 2fa3cc03a58325fe1061fa1391fdfc245a739f71 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2fa3cc03a58325fe1061fa1…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Fri Jun 30 11:07:26 2006 +0100 oleaut32: Fix a typo where the FIXME doesn't match the code. --- dlls/oleaut32/typelib.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 11302be..71dec16 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4981,7 +4981,7 @@ static HRESULT userdefined_to_variantvt( break; case TKIND_UNION: - FIXME("TKIND_RECORD unhandled.\n"); + FIXME("TKIND_UNION unhandled.\n"); hr = E_NOTIMPL; break;
1
0
0
0
Robert Shearman : rpcrt4: Add a stub for RpcMgmtSetServerStackSize.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: e7df38c27f78bf9fb00073f40955190c95804b2b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e7df38c27f78bf9fb00073f…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Fri Jun 30 11:07:07 2006 +0100 rpcrt4: Add a stub for RpcMgmtSetServerStackSize. --- dlls/rpcrt4/rpc_server.c | 11 ++++++++++- dlls/rpcrt4/rpcrt4.spec | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index 3f3c9ca..7dceb2d 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -997,10 +997,19 @@ RPC_STATUS WINAPI RpcMgmtEpEltInqBegin(R } /*********************************************************************** - * RpcMgmtEpEltInqBegin (RPCRT4.@) + * RpcMgmtIsServerListening (RPCRT4.@) */ RPC_STATUS WINAPI RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding) { FIXME("(%p): stub\n", Binding); return RPC_S_INVALID_BINDING; } + +/*********************************************************************** + * RpcMgmtSetServerStackSize (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtSetServerStackSize(unsigned int ThreadStackSize) +{ + FIXME("(0x%x): stub\n", ThreadStackSize); + return RPC_S_OK; +} diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index cd1bcf2..5141165 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -441,7 +441,7 @@ # 9x version of I_RpcBindingSetAsync has @ stub RpcMgmtSetCancelTimeout @ stdcall RpcMgmtSetComTimeout(ptr long) @ stub RpcMgmtSetParameter # win9x -@ stub RpcMgmtSetServerStackSize +@ stdcall RpcMgmtSetServerStackSize(long) @ stub RpcMgmtStatsVectorFree @ stdcall RpcMgmtStopServerListening(ptr) @ stdcall RpcMgmtWaitServerListen()
1
0
0
0
Robert Shearman : advapi32: Implement RegDisablePredefinedCache.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: 52aaddcd3493c263d3e60533ac3473804aad3f47 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=52aaddcd3493c263d3e6053…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Fri Jun 30 11:06:48 2006 +0100 advapi32: Implement RegDisablePredefinedCache. --- dlls/advapi32/advapi32.spec | 2 +- dlls/advapi32/registry.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 438b671..4826df9 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -475,7 +475,7 @@ # @ stub ReadEncryptedFileRaw @ stdcall RegDeleteKeyW(long wstr) @ stdcall RegDeleteValueA(long str) @ stdcall RegDeleteValueW(long wstr) -# @ stub RegDisablePredefinedCache +@ stdcall RegDisablePredefinedCache() @ stdcall RegEnumKeyA(long long ptr long) @ stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr) @ stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 7790862..e99cce7 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -52,6 +52,7 @@ #define HKEY_SPECIAL_ROOT_LAST HKEY_D #define NB_SPECIAL_ROOT_KEYS ((UINT)HKEY_SPECIAL_ROOT_LAST - (UINT)HKEY_SPECIAL_ROOT_FIRST + 1) static HKEY special_root_keys[NB_SPECIAL_ROOT_KEYS]; +static BOOL hkcu_cache_disabled; static const WCHAR name_CLASSES_ROOT[] = {'M','a','c','h','i','n','e','\\', @@ -108,6 +109,10 @@ static HKEY create_special_root_hkey( HA { if (RtlOpenCurrentUser( access, &hkey )) return 0; TRACE( "HKEY_CURRENT_USER -> %p\n", hkey ); + + /* don't cache the key in the table if caching is disabled */ + if (hkcu_cache_disabled) + return hkey; } else { @@ -2565,3 +2570,34 @@ cleanup: return result; } + +/****************************************************************************** + * RegDisablePredefinedCache [ADVAPI32.@] + * + * Disables the caching of the HKEY_CLASSES_ROOT key for the process. + * + * PARAMS + * None. + * + * RETURNS + * Success: ERROR_SUCCESS + * Failure: nonzero error code from Winerror.h + * + * NOTES + * This is useful for services that use impersonation. + */ +LONG WINAPI RegDisablePredefinedCache(void) +{ + HKEY hkey_current_user; + int idx = (UINT_PTR)HKEY_CURRENT_USER - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST; + + /* prevent caching of future requests */ + hkcu_cache_disabled = TRUE; + + hkey_current_user = InterlockedExchangePointer( (void **)&special_root_keys[idx], NULL ); + + if (hkey_current_user) + NtClose( hkey_current_user ); + + return ERROR_SUCCESS; +}
1
0
0
0
Paul Vriens : ntdll: Fix return codes for NtCreateKey (with tests).
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: 8a42a8c11a125c5a08518342faf53ec20006473c URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=8a42a8c11a125c5a0851834…
Author: Paul Vriens <Paul.Vriens(a)xs4all.nl> Date: Fri Jun 30 09:04:03 2006 +0200 ntdll: Fix return codes for NtCreateKey (with tests). --- dlls/ntdll/reg.c | 3 ++- dlls/ntdll/tests/reg.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index d0c5e62..5a1f5c2 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -58,8 +58,9 @@ NTSTATUS WINAPI NtCreateKey( PHANDLE ret TRACE( "(%p,%s,%s,%lx,%lx,%p)\n", attr->RootDirectory, debugstr_us(attr->ObjectName), debugstr_us(class), options, access, retkey ); + if (!retkey || !attr) return STATUS_ACCESS_VIOLATION; + if (attr->Length > sizeof(OBJECT_ATTRIBUTES)) return STATUS_INVALID_PARAMETER; if (attr->ObjectName->Length > MAX_NAME_LENGTH) return STATUS_BUFFER_OVERFLOW; - if (!retkey) return STATUS_INVALID_PARAMETER; SERVER_START_REQ( create_key ) { diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 0b1cc43..654ae64 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -298,10 +298,38 @@ static void test_NtCreateKey(void) ACCESS_MASK am = GENERIC_ALL; NTSTATUS status; + /* All NULL */ + status = pNtCreateKey(NULL, 0, NULL, 0, 0, 0, 0); + ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx\n", status); + + /* Only the key */ + status = pNtCreateKey(&key, 0, NULL, 0, 0, 0, 0); + ok(status == STATUS_ACCESS_VIOLATION /* W2K3/XP/W2K */ || status == STATUS_INVALID_PARAMETER /* NT4 */, + "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08lx\n", status); + + /* Only accessmask */ + status = pNtCreateKey(NULL, am, NULL, 0, 0, 0, 0); + ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx\n", status); + + /* Key and accessmask */ + status = pNtCreateKey(&key, am, NULL, 0, 0, 0, 0); + ok(status == STATUS_ACCESS_VIOLATION /* W2K3/XP/W2K */ || status == STATUS_INVALID_PARAMETER /* NT4 */, + "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08lx\n", status); + InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); + + /* Only attributes */ + status = pNtCreateKey(NULL, 0, &attr, 0, 0, 0, 0); + ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx\n", status); + status = pNtCreateKey(&key, am, &attr, 0, 0, 0, 0); ok(status == STATUS_SUCCESS, "NtCreateKey Failed: 0x%08lx\n", status); + /* Length > sizeof(OBJECT_ATTRIBUTES) */ + attr.Length *= 2; + status = pNtCreateKey(&key, am, &attr, 0, 0, 0, 0); + ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got: 0x%08lx\n", status); + pNtClose(&key); }
1
0
0
0
James Hawkins : shlwapi: Add tests for PathFindExtensionA.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: ad064915c957dd89e322bfe868c3b4c0d0c8e70a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ad064915c957dd89e322bfe…
Author: James Hawkins <truiken(a)gmail.com> Date: Thu Jun 29 13:33:18 2006 -0700 shlwapi: Add tests for PathFindExtensionA. --- dlls/shlwapi/tests/path.c | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c index 49d378a..183c936 100644 --- a/dlls/shlwapi/tests/path.c +++ b/dlls/shlwapi/tests/path.c @@ -1419,6 +1419,72 @@ static void test_PathCanonicalizeA(void) ok(lstrlen(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlen(too_long)); } +static void test_PathFindExtensionA(void) +{ + LPSTR ext; + char path[MAX_PATH]; + char too_long[LONG_LEN]; + + /* try a NULL path */ + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(NULL); + ok(ext == NULL, "Expected NULL, got %p\n", ext); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + + /* try an empty path */ + path[0] = '\0'; + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(path); + ok(ext == path, "Expected ext == path, got %p\n", ext); + ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext)); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + + /* try a path without an extension */ + lstrcpy(path, "file"); + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(path); + ok(ext == path + lstrlen(path), "Expected ext == path, got %p\n", ext); + ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext)); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + + /* try a path with an extension */ + lstrcpy(path, "file.txt"); + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(path); + ok(ext == path + lstrlen("file"), + "Expected ext == path + lstrlen(\"file\"), got %p\n", ext); + ok(!lstrcmp(ext, ".txt"), "Expected .txt, got %s\n", ext); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + + /* try a path with two extensions */ + lstrcpy(path, "file.txt.doc"); + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(path); + ok(ext == path + lstrlen("file.txt"), + "Expected ext == path + lstrlen(\"file.txt\"), got %p\n", ext); + ok(!lstrcmp(ext, ".doc"), "Expected .txt, got %s\n", ext); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + + /* try a path longer than MAX_PATH without an extension*/ + memset(too_long, 'a', LONG_LEN); + too_long[LONG_LEN - 1] = '\0'; + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(too_long); + ok(ext == too_long + LONG_LEN - 1, "Expected ext == too_long + LONG_LEN - 1, got %p\n", ext); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + + /* try a path longer than MAX_PATH with an extension*/ + memset(too_long, 'a', LONG_LEN); + too_long[LONG_LEN - 1] = '\0'; + lstrcpy(too_long + 300, ".abcde"); + too_long[lstrlen(too_long)] = 'a'; + SetLastError(0xdeadbeef); + ext = PathFindExtensionA(too_long); + ok(ext == too_long + 300, "Expected ext == too_long + 300, got %p\n", ext); + ok(lstrlen(ext) == LONG_LEN - 301, "Expected LONG_LEN - 301, got %i\n", lstrlen(ext)); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); +} + START_TEST(path) { hShlwapi = LoadLibraryA("shlwapi.dll"); @@ -1460,4 +1526,5 @@ START_TEST(path) test_PathCombineA(); test_PathAppendA(); test_PathCanonicalizeA(); + test_PathFindExtensionA(); }
1
0
0
0
James Hawkins : shlwapi: Add tests for PathCanonicalize.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: b333f0c4d2babe40ab16a7a3f558266c94fd96b5 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b333f0c4d2babe40ab16a7a…
Author: James Hawkins <truiken(a)gmail.com> Date: Thu Jun 29 13:33:05 2006 -0700 shlwapi: Add tests for PathCanonicalize. --- dlls/shlwapi/tests/path.c | 124 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-) diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c index 826b6b6..49d378a 100644 --- a/dlls/shlwapi/tests/path.c +++ b/dlls/shlwapi/tests/path.c @@ -1296,6 +1296,129 @@ static void test_PathAppendA(void) ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); } +static void test_PathCanonicalizeA(void) +{ + char dest[MAX_PATH]; + char too_long[LONG_LEN]; + BOOL res; + + /* try a NULL source */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, NULL); + ok(!res, "Expected failure\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); + todo_wine + { + ok(!lstrcmp(dest, "test"), "Expected test, got %s\n", dest); + } + + /* try an empty source */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, ""); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "\\"), "Expected \\, got %s\n", dest); + + /* try a NULL dest */ + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(NULL, "C:\\"); + ok(!res, "Expected failure\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); + + /* try empty dest */ + dest[0] = '\0'; + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\"); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest); + + /* try non-empty dest */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\"); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest); + + /* try a space for source */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, " "); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, " "), "Expected ' ', got %s\n", dest); + + /* try a relative path */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "one\\two"); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "one\\two"), "Expected one\\two, got %s\n", dest); + + /* try current dir and previous dir */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\one\\.\\..\\two\\three\\.."); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\two"), "Expected C:\\two, got %s\n", dest); + + /* try simple forward slashes */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\one/two/three\\four/five\\six"); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\one/two/three\\four/five\\six"), + "Expected C:\\one/two/three\\four/five\\six, got %s\n", dest); + + /* try simple forward slashes with same dir */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\one/.\\two"); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\one/.\\two"), "Expected C:\\one/.\\two, got %s\n", dest); + + /* try simple forward slashes with change dir */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\one/.\\two\\.."); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\one/."), "Expected C:\\one/., got %s\n", dest); + + /* try forward slashes with change dirs + * NOTE: if there is a forward slash in between two backslashes, + * everything in between the two backslashes is considered on dir + */ + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, "C:\\one/.\\..\\two/three\\..\\four/.five"); + ok(res, "Expected success\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + ok(!lstrcmp(dest, "C:\\four/.five"), "Expected C:\\four/.five, got %s\n", dest); + + /* try src is too long */ + memset(too_long, 'a', LONG_LEN); + too_long[LONG_LEN - 1] = '\0'; + lstrcpy(dest, "test"); + SetLastError(0xdeadbeef); + res = PathCanonicalizeA(dest, too_long); + todo_wine + { + ok(!res, "Expected failure\n"); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); + } + ok(lstrlen(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlen(too_long)); +} + START_TEST(path) { hShlwapi = LoadLibraryA("shlwapi.dll"); @@ -1336,4 +1459,5 @@ START_TEST(path) test_PathCombineA(); test_PathAppendA(); + test_PathCanonicalizeA(); }
1
0
0
0
Mikołaj Zalewski : shell32: Use SHFileOperationW to delete files.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: 86fe1a0d5fc63c3eef9271a46cba8350e6d38b5d URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=86fe1a0d5fc63c3eef9271a…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Thu Jun 29 21:03:41 2006 +0200 shell32: Use SHFileOperationW to delete files. --- dlls/shell32/shfldr_fs.c | 107 ++++++++++++++++++++++++++++++---------------- 1 files changed, 69 insertions(+), 38 deletions(-) diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index d683007..4e1c878 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -1155,6 +1155,36 @@ ISFHelper_fnAddFolder (ISFHelper * iface } /**************************************************************************** + * build_paths_list + * + * Builds a list of paths like the one used in SHFileOperation from a table of + * PIDLs relative to the given base folder + */ +WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls) +{ + WCHAR *wszPathsList; + WCHAR *wszListPos; + int iPathLen; + int i; + + iPathLen = lstrlenW(wszBasePath); + wszPathsList = HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(WCHAR)*cidl+1); + wszListPos = wszPathsList; + + for (i = 0; i < cidl; i++) { + if (!_ILIsFolder(pidls[i]) && !_ILIsValue(pidls[i])) + continue; + + lstrcpynW(wszListPos, wszBasePath, MAX_PATH); + /* FIXME: abort if path too long */ + _ILSimpleGetTextW(pidls[i], wszListPos+iPathLen, MAX_PATH-iPathLen); + wszListPos += lstrlenW(wszListPos)+1; + } + *wszListPos=0; + return wszPathsList; +} + +/**************************************************************************** * ISFHelper_fnDeleteItems * * deletes items in folder @@ -1164,59 +1194,60 @@ ISFHelper_fnDeleteItems (ISFHelper * ifa { IGenericSFImpl *This = impl_from_ISFHelper(iface); UINT i; + SHFILEOPSTRUCTW op; WCHAR wszPath[MAX_PATH]; - int iPathLen; - BOOL bConfirm = TRUE; + WCHAR *wszPathsList; + HRESULT ret; + WCHAR *wszCurrentPath; TRACE ("(%p)(%u %p)\n", This, cidl, apidl); - - /* deleting multiple items so give a slightly different warning */ - if (cidl != 1) { - WCHAR tmp[8]; - static const WCHAR format[] = {'%','d',0}; - - wnsprintfW (tmp, sizeof(tmp)/sizeof(tmp[0]), format, cidl); - if (!SHELL_ConfirmDialogW(ASK_DELETE_MULTIPLE_ITEM, tmp)) - return E_FAIL; - bConfirm = FALSE; - } + if (cidl==0) return S_OK; if (This->sPathTarget) lstrcpynW(wszPath, This->sPathTarget, MAX_PATH); else wszPath[0] = '\0'; PathAddBackslashW(wszPath); - iPathLen = lstrlenW(wszPath); - - for (i = 0; i < cidl; i++) { - _ILSimpleGetTextW (apidl[i], wszPath+iPathLen, MAX_PATH-iPathLen); + wszPathsList = build_paths_list(wszPath, cidl, apidl); + + ZeroMemory(&op, sizeof(op)); + op.hwnd = GetActiveWindow(); + op.wFunc = FO_DELETE; + op.pFrom = wszPathsList; + op.fFlags = 0; + if (SHFileOperationW(&op)) + { + WARN("SHFileOperation failed\n"); + ret = E_FAIL; + } + else + ret = S_OK; - if (_ILIsFolder (apidl[i])) { - LPITEMIDLIST pidl; + /* we currently need to manually send the notifies */ + wszCurrentPath = wszPathsList; + for (i = 0; i < cidl; i++) + { + LONG wEventId; - TRACE ("delete %s\n", debugstr_w(wszPath)); - if (!SHELL_DeleteDirectoryW (wszPath, bConfirm)) { - TRACE ("delete %s failed, bConfirm=%d\n", debugstr_w(wszPath), bConfirm); - return E_FAIL; - } - pidl = ILCombine (This->pidlRoot, apidl[i]); - SHChangeNotify (SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL); - SHFree (pidl); - } else if (_ILIsValue (apidl[i])) { - LPITEMIDLIST pidl; + if (_ILIsFolder(apidl[i])) + wEventId = SHCNE_RMDIR; + else if (_ILIsValue(apidl[i])) + wEventId = SHCNE_DELETE; + else + continue; - TRACE ("delete %s\n", debugstr_w(wszPath)); - if (!SHELL_DeleteFileW (wszPath, bConfirm)) { - TRACE ("delete %s failed, bConfirm=%d\n", debugstr_w(wszPath), bConfirm); - return E_FAIL; - } - pidl = ILCombine (This->pidlRoot, apidl[i]); - SHChangeNotify (SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL); - SHFree (pidl); + /* check if file exists */ + if (GetFileAttributesW(wszCurrentPath) == INVALID_FILE_ATTRIBUTES) + { + LPITEMIDLIST pidl = ILCombine(This->pidlRoot, apidl[i]); + SHChangeNotify(wEventId, SHCNF_IDLIST, pidl, NULL); + SHFree(pidl); } + wszCurrentPath += lstrlenW(wszCurrentPath)+1; } - return S_OK; + HeapFree(GetProcessHeap(), 0, wszPathsList); + return ret; } /****************************************************************************
1
0
0
0
Ivan Leo : shell32/tests: Comment out a test that crashes on windows nt 4.0 .
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: 48374cf630f27d7e35b3ff83503cd6b7c3c85607 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=48374cf630f27d7e35b3ff8…
Author: Ivan Leo <ivanleo(a)gmail.com> Date: Thu Jun 29 19:51:49 2006 +0100 shell32/tests: Comment out a test that crashes on windows nt 4.0. --- dlls/shell32/tests/shlfileop.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index a1180fc..12b2862 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -343,10 +343,12 @@ static void test_rename(void) retval = SHFileOperationA(&shfo); ok(retval == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED, got %ld\n", retval); - /* pFrom is NULL */ + /* pFrom is NULL, commented out because it crashes on nt 4.0 */ +#if 0 shfo.pFrom = NULL; retval = SHFileOperationA(&shfo); - ok(retval == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", retval); + ok(retval == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", retval); +#endif } /* tests the FO_COPY action */
1
0
0
0
Stefan Dösinger : ddraw: Fix some material related bugs.
by Alexandre Julliard
30 Jun '06
30 Jun '06
Module: wine Branch: refs/heads/master Commit: b0c7bee2ef4f64279dfd03367629f084444f83fa URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b0c7bee2ef4f64279dfd033…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Thu Jun 29 14:20:39 2006 +0200 ddraw: Fix some material related bugs. --- dlls/ddraw/device.c | 20 ++++++++++++++++++-- dlls/ddraw/material.c | 1 + dlls/ddraw/viewport.c | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 8417340..63f272b 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -1639,7 +1639,7 @@ IDirect3DDeviceImpl_3_GetCurrentViewport *Direct3DViewport3 = ICOM_INTERFACE(This->current_viewport, IDirect3DViewport3); /* AddRef the returned viewport */ - IDirect3DViewport3_AddRef(*Direct3DViewport3); + if(*Direct3DViewport3) IDirect3DViewport3_AddRef(*Direct3DViewport3); TRACE(" returning interface %p\n", *Direct3DViewport3); @@ -2279,7 +2279,23 @@ IDirect3DDeviceImpl_3_SetLightState(IDir if (LightStateType == D3DLIGHTSTATE_MATERIAL /* 1 */) { - IDirect3DMaterialImpl *mat = (IDirect3DMaterialImpl *) Value; + IDirect3DMaterialImpl *mat; + + if(Value == 0) mat = NULL; + else if(Value > This->numHandles) + { + ERR("Material handle out of range(%ld)\n", Value); + return DDERR_INVALIDPARAMS; + } + else if(This->Handles[Value - 1].type != DDrawHandle_Material) + { + ERR("Invalid handle %ld\n", Value); + return DDERR_INVALIDPARAMS; + } + else + { + mat = (IDirect3DMaterialImpl *) This->Handles[Value - 1].ptr; + } if (mat != NULL) { diff --git a/dlls/ddraw/material.c b/dlls/ddraw/material.c index c2acce1..3483c72 100644 --- a/dlls/ddraw/material.c +++ b/dlls/ddraw/material.c @@ -311,6 +311,7 @@ IDirect3DMaterialImpl_GetHandle(IDirect3 IDirect3DDeviceImpl *device = ICOM_OBJECT(IDirect3DDeviceImpl, IDirect3DDevice3, lpDirect3DDevice3); TRACE("(%p/%p)->(%p,%p)\n", This, iface, device, lpHandle); + This->active_device = device; if(!This->Handle) { This->Handle = IDirect3DDeviceImpl_CreateHandle(device); diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index 29acebf..71c426b 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -310,7 +310,7 @@ IDirect3DViewportImpl_SetViewport(IDirec IDirect3DDevice3_GetCurrentViewport(ICOM_INTERFACE(This->active_device, IDirect3DDevice3), ¤t_viewport); if (ICOM_OBJECT(IDirect3DViewportImpl, IDirect3DViewport3, current_viewport) == This) This->activate(This); - IDirect3DViewport3_Release(current_viewport); + if(current_viewport) IDirect3DViewport3_Release(current_viewport); } return DD_OK;
1
0
0
0
← Newer
1
2
3
4
5
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200