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
May 2007
----- 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
715 discussions
Start a n
N
ew thread
Rob Shearman : server: Move most of the duplicate_token request to a new function, token_duplicate, to enable the code to be used inside wineserver.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: bdf964dce80c66c7eb4d9ad5376393648dbb2075 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bdf964dce80c66c7eb4d9ad53…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Mon May 28 18:39:33 2007 +0100 server: Move most of the duplicate_token request to a new function, token_duplicate, to enable the code to be used inside wineserver. --- server/security.h | 2 + server/token.c | 101 +++++++++++++++++++++++++++++------------------------ 2 files changed, 57 insertions(+), 46 deletions(-) diff --git a/server/security.h b/server/security.h index 20f42e3..f0c1b8c 100644 --- a/server/security.h +++ b/server/security.h @@ -42,6 +42,8 @@ extern const LUID SeCreateGlobalPrivilege; extern const PSID security_interactive_sid; extern struct token *token_create_admin(void); +extern struct token *token_duplicate( struct token *src_token, unsigned primary, + SECURITY_IMPERSONATION_LEVEL impersonation_level ); extern int token_check_privileges( struct token *token, int all_required, const LUID_AND_ATTRIBUTES *reqprivs, unsigned int count, LUID_AND_ATTRIBUTES *usedprivs); diff --git a/server/token.c b/server/token.c index 9472cf5..8975c54 100644 --- a/server/token.c +++ b/server/token.c @@ -520,6 +520,59 @@ static struct token *create_token( unsigned primary, const SID *user, return token; } +struct token *token_duplicate( struct token *src_token, unsigned primary, + SECURITY_IMPERSONATION_LEVEL impersonation_level ) +{ + const luid_t *modified_id = + primary || (impersonation_level == src_token->impersonation_level) ? + &src_token->modified_id : NULL; + struct token *token = NULL; + struct privilege *privilege; + struct group *group; + + if ((impersonation_level < SecurityAnonymous) || + (impersonation_level > SecurityDelegation)) + { + set_error( STATUS_BAD_IMPERSONATION_LEVEL ); + return NULL; + } + + if (primary || (impersonation_level <= src_token->impersonation_level)) + token = create_token( primary, src_token->user, NULL, 0, + NULL, 0, src_token->default_dacl, + src_token->source, modified_id, + impersonation_level ); + else set_error( STATUS_BAD_IMPERSONATION_LEVEL ); + + if (!token) return token; + + /* copy groups */ + LIST_FOR_EACH_ENTRY( group, &src_token->groups, struct group, entry ) + { + size_t size = FIELD_OFFSET( struct group, sid.SubAuthority[group->sid.SubAuthorityCount] ); + struct group *newgroup = mem_alloc( size ); + if (!newgroup) + { + release_object( token ); + return NULL; + } + memcpy( newgroup, group, size ); + list_add_tail( &token->groups, &newgroup->entry ); + } + token->primary_group = src_token->primary_group; + assert( token->primary_group ); + + /* copy privileges */ + LIST_FOR_EACH_ENTRY( privilege, &src_token->privileges, struct privilege, entry ) + if (!privilege_add( token, &privilege->luid, privilege->enabled )) + { + release_object( token ); + return NULL; + } + + return token; +} + static ACL *create_default_dacl( const SID *user ) { ACCESS_ALLOWED_ACE *aaa; @@ -1170,58 +1223,14 @@ DECL_HANDLER(duplicate_token) { struct token *src_token; - if ((req->impersonation_level < SecurityAnonymous) || - (req->impersonation_level > SecurityDelegation)) - { - set_error( STATUS_BAD_IMPERSONATION_LEVEL ); - return; - } - if ((src_token = (struct token *)get_handle_obj( current->process, req->handle, TOKEN_DUPLICATE, &token_ops ))) { - const luid_t *modified_id = - req->primary || (req->impersonation_level == src_token->impersonation_level) ? - &src_token->modified_id : NULL; - struct token *token = NULL; - - if (req->primary || (req->impersonation_level <= src_token->impersonation_level)) - token = create_token( req->primary, src_token->user, NULL, 0, - NULL, 0, src_token->default_dacl, - src_token->source, modified_id, - req->impersonation_level ); - else set_error( STATUS_BAD_IMPERSONATION_LEVEL ); - + struct token *token = token_duplicate( src_token, req->primary, req->impersonation_level ); if (token) { - struct privilege *privilege; - struct group *group; - unsigned int access; - - /* copy groups */ - LIST_FOR_EACH_ENTRY( group, &src_token->groups, struct group, entry ) - { - size_t size = FIELD_OFFSET( struct group, sid.SubAuthority[group->sid.SubAuthorityCount] ); - struct group *newgroup = mem_alloc( size ); - if (!newgroup) - { - release_object( token ); - release_object( src_token ); - return; - } - memcpy( newgroup, group, size ); - list_add_tail( &token->groups, &newgroup->entry ); - } - token->primary_group = src_token->primary_group; - assert( token->primary_group ); - - /* copy privileges */ - LIST_FOR_EACH_ENTRY( privilege, &src_token->privileges, struct privilege, entry ) - privilege_add( token, &privilege->luid, privilege->enabled ); - - access = req->access; - reply->new_handle = alloc_handle( current->process, token, access, req->attributes); + reply->new_handle = alloc_handle( current->process, token, req->access, req->attributes); release_object( token ); } release_object( src_token );
1
0
0
0
Misha Koshelev : shell32/tests: Remove duplicate code.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: c7aa087504654cf2d3538bc970f3783bbab3a034 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c7aa087504654cf2d3538bc97…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Sun May 27 20:01:13 2007 -0500 shell32/tests: Remove duplicate code. --- dlls/shell32/tests/shlexec.c | 44 ++++++----------------------------------- 1 files changed, 7 insertions(+), 37 deletions(-) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 2b19a76..8894364 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -233,43 +233,6 @@ static void delete_test_association(const char* extension) SHDeleteKey(HKEY_CLASSES_ROOT, extension); } -static void create_test_verb(const char* extension, const char* verb, - int rawcmd, const char* cmdtail) -{ - HKEY hkey_shell, hkey_verb, hkey_cmd; - char shell[MAX_PATH]; - char* cmd; - LONG rc; - - sprintf(shell, "shlexec%s\\shell", extension); - rc=RegOpenKeyEx(HKEY_CLASSES_ROOT, shell, 0, - KEY_CREATE_SUB_KEY, &hkey_shell); - assert(rc==ERROR_SUCCESS); - rc=RegCreateKeyEx(hkey_shell, verb, 0, NULL, 0, KEY_CREATE_SUB_KEY, - NULL, &hkey_verb, NULL); - assert(rc==ERROR_SUCCESS); - rc=RegCreateKeyEx(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_cmd, NULL); - assert(rc==ERROR_SUCCESS); - - if (rawcmd) - { - rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmdtail, strlen(cmdtail)+1); - } - else - { - cmd=malloc(strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1); - sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail); - rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1); - assert(rc==ERROR_SUCCESS); - free(cmd); - } - - CloseHandle(hkey_shell); - CloseHandle(hkey_verb); - CloseHandle(hkey_cmd); -} - static void create_test_verb_dde(const char* extension, const char* verb, int rawcmd, const char* cmdtail, const char *ddeexec, const char *application, const char *topic, @@ -352,6 +315,13 @@ static void create_test_verb_dde(const char* extension, const char* verb, CloseHandle(hkey_cmd); } +static void create_test_verb(const char* extension, const char* verb, + int rawcmd, const char* cmdtail) +{ + create_test_verb_dde(extension, verb, rawcmd, cmdtail, NULL, NULL, + NULL, NULL); +} + /*** * * Functions to check that the child process was started just right
1
0
0
0
Misha Koshelev : shell32: Handle default DDE application names.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: efb92561e69569991dfdbd8c119d57a74d77e219 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=efb92561e69569991dfdbd8c1…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Sun May 27 20:01:10 2007 -0500 shell32: Handle default DDE application names. --- dlls/shell32/shlexec.c | 47 ++++++++++++++++++++++++++++++++++++++++- dlls/shell32/tests/shlexec.c | 34 +++++++++++++++--------------- 2 files changed, 62 insertions(+), 19 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 0d2b364..edb65ea 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -780,8 +780,51 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, applen = sizeof(app); if (RegQueryValueW(HKEY_CLASSES_ROOT, key, app, &applen) != ERROR_SUCCESS) { - FIXME("default app name NIY %s\n", debugstr_w(key)); - return 2; + WCHAR command[1024], fullpath[MAX_PATH]; + static const WCHAR wSo[] = { '.','s','o',0 }; + int sizeSo = sizeof(wSo)/sizeof(WCHAR); + LPWSTR ptr = NULL; + DWORD ret = 0; + + /* Get application command from start string and find filename of application */ + if (*start == '"') + { + strcpyW(command, start+1); + if ((ptr = strchrW(command, '"'))) + *ptr = 0; + ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr); + } + else + { + LPWSTR p,space; + for (p=(LPWSTR)start; (space=strchrW(p, ' ')); p=space+1) + { + int idx = space-start; + memcpy(command, start, idx*sizeof(WCHAR)); + command[idx] = '\0'; + if ((ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr))) + break; + } + if (!ret) + ret = SearchPathW(NULL, start, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr); + } + + if (!ret) + { + ERR("Unable to find application path for command %s\n", debugstr_w(start)); + return ERROR_ACCESS_DENIED; + } + strcpyW(app, ptr); + + /* Remove extensions (including .so) */ + ptr = app + strlenW(app) - (sizeSo-1); + if (strlenW(app) >= sizeSo && + !strcmpW(ptr, wSo)) + *ptr = 0; + + ptr = strrchrW(app, '.'); + assert(ptr); + *ptr = 0; } strcpyW(endkey, wTopic); diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 37f736d..2b19a76 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -1099,7 +1099,7 @@ static dde_tests_t dde_tests[] = {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]", 0x0, 33}, /* Test default DDE application */ - {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0x1, 33}, + {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0x0, 33}, {NULL, NULL, NULL, NULL, 0x0, 0} }; @@ -1284,37 +1284,37 @@ typedef struct static dde_default_app_tests_t dde_default_app_tests[] = { /* Test unquoted existing filename with a space */ - {"%s\\test file.exe", "test file", 0x1, 33}, - {"%s\\test file.exe param", "test file", 0x1, 33}, + {"%s\\test file.exe", "test file", 0x0, 33}, + {"%s\\test file.exe param", "test file", 0x0, 33}, /* Test quoted existing filename with a space */ - {"\"%s\\test file.exe\"", "test file", 0x1, 33}, - {"\"%s\\test file.exe\" param", "test file", 0x1, 33}, + {"\"%s\\test file.exe\"", "test file", 0x0, 33}, + {"\"%s\\test file.exe\" param", "test file", 0x0, 33}, /* Test unquoted filename with a space that doesn't exist, but * test2.exe does */ - {"%s\\test2 file.exe", "test2", 0x1, 33}, - {"%s\\test2 file.exe param", "test2", 0x1, 33}, + {"%s\\test2 file.exe", "test2", 0x0, 33}, + {"%s\\test2 file.exe param", "test2", 0x0, 33}, /* Test quoted filename with a space that does not exist */ - {"\"%s\\test2 file.exe\"", "", 0x1, 5}, - {"\"%s\\test2 file.exe\" param", "", 0x1, 5}, + {"\"%s\\test2 file.exe\"", "", 0x0, 5}, + {"\"%s\\test2 file.exe\" param", "", 0x0, 5}, /* Test filename supplied without the extension */ - {"%s\\test2", "test2", 0x1, 33}, - {"%s\\test2 param", "test2", 0x1, 33}, + {"%s\\test2", "test2", 0x0, 33}, + {"%s\\test2 param", "test2", 0x0, 33}, /* Test an unquoted non-existent filename */ - {"%s\\notexist.exe", "", 0x1, 5}, - {"%s\\notexist.exe param", "", 0x1, 5}, + {"%s\\notexist.exe", "", 0x0, 5}, + {"%s\\notexist.exe param", "", 0x0, 5}, /* Test an application that will be found on the path */ - {"cmd", "cmd", 0x1, 33}, - {"cmd param", "cmd", 0x1, 33}, + {"cmd", "cmd", 0x0, 33}, + {"cmd param", "cmd", 0x0, 33}, /* Test an application that will not be found on the path */ - {"xyzwxyzwxyz", "", 0x1, 5}, - {"xyzwxyzwxyz param", "", 0x1, 5}, + {"xyzwxyzwxyz", "", 0x0, 5}, + {"xyzwxyzwxyz param", "", 0x0, 5}, {NULL, NULL, 0, 0} };
1
0
0
0
Misha Koshelev : shell32/tests: Add tests for default DDE application name.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: c8829f5645af7647397a113e957f8a8f40466b7a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8829f5645af7647397a113e9…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Sun May 27 20:01:06 2007 -0500 shell32/tests: Add tests for default DDE application name. --- dlls/shell32/tests/shlexec.c | 164 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 154 insertions(+), 10 deletions(-) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index eabd25c..37f736d 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -567,6 +567,8 @@ static const char* testfiles[]= "%s\\masked file.shlexec", "%s\\masked", "%s\\test file.sde", + "%s\\test file.exe", + "%s\\test2.exe", NULL }; @@ -1102,8 +1104,9 @@ static dde_tests_t dde_tests[] = {NULL, NULL, NULL, NULL, 0x0, 0} }; +static DWORD ddeInst; static HSZ hszTopic; -static char ddeExec[MAX_PATH]; +static char ddeExec[MAX_PATH], ddeApplication[MAX_PATH]; static BOOL denyNextConnection; static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv, @@ -1124,7 +1127,11 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv, if (denyNextConnection) denyNextConnection = FALSE; else + { + size = DdeQueryString(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI); + assert(size < MAX_PATH); return (HDDEDATA)TRUE; + } } return (HDDEDATA)FALSE; @@ -1167,12 +1174,12 @@ static void test_dde(void) dde_thread_info_t info = { filename, GetCurrentThreadId() }; const dde_tests_t* test; char params[1024]; - DWORD inst = 0; HANDLE hThread; MSG msg; int rc; - rc = DdeInitializeA(&inst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | + ddeInst = 0; + rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0L); assert(rc == DMLERR_NO_ERROR); @@ -1188,12 +1195,12 @@ static void test_dde(void) create_test_association(".sde"); create_test_verb_dde(".sde", "Open", 0, test->command, test->ddeexec, test->application, test->topic, test->ifexec); - hszApplication = DdeCreateStringHandleA(inst, test->application ? + hszApplication = DdeCreateStringHandleA(ddeInst, test->application ? test->application : defApplication, CP_WINANSI); - hszTopic = DdeCreateStringHandleA(inst, test->topic ? test->topic : SZDDESYS_TOPIC, + hszTopic = DdeCreateStringHandleA(ddeInst, test->topic ? test->topic : SZDDESYS_TOPIC, CP_WINANSI); assert(hszApplication && hszTopic); - assert(DdeNameService(inst, hszApplication, 0L, DNS_REGISTER)); + assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_REGISTER)); denyNextConnection = TRUE; ddeExec[0] = 0; @@ -1256,14 +1263,150 @@ static void test_dde(void) } } - assert(DdeNameService(inst, hszApplication, 0L, DNS_UNREGISTER)); - assert(DdeFreeStringHandle(inst, hszTopic)); - assert(DdeFreeStringHandle(inst, hszApplication)); + assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_UNREGISTER)); + assert(DdeFreeStringHandle(ddeInst, hszTopic)); + assert(DdeFreeStringHandle(ddeInst, hszApplication)); + delete_test_association(".sde"); + test++; + } + + assert(DdeUninitialize(ddeInst)); +} + +typedef struct +{ + const char* command; + const char* expectedDdeApplication; + int todo; + int rc; +} dde_default_app_tests_t; + +static dde_default_app_tests_t dde_default_app_tests[] = +{ + /* Test unquoted existing filename with a space */ + {"%s\\test file.exe", "test file", 0x1, 33}, + {"%s\\test file.exe param", "test file", 0x1, 33}, + + /* Test quoted existing filename with a space */ + {"\"%s\\test file.exe\"", "test file", 0x1, 33}, + {"\"%s\\test file.exe\" param", "test file", 0x1, 33}, + + /* Test unquoted filename with a space that doesn't exist, but + * test2.exe does */ + {"%s\\test2 file.exe", "test2", 0x1, 33}, + {"%s\\test2 file.exe param", "test2", 0x1, 33}, + + /* Test quoted filename with a space that does not exist */ + {"\"%s\\test2 file.exe\"", "", 0x1, 5}, + {"\"%s\\test2 file.exe\" param", "", 0x1, 5}, + + /* Test filename supplied without the extension */ + {"%s\\test2", "test2", 0x1, 33}, + {"%s\\test2 param", "test2", 0x1, 33}, + + /* Test an unquoted non-existent filename */ + {"%s\\notexist.exe", "", 0x1, 5}, + {"%s\\notexist.exe param", "", 0x1, 5}, + + /* Test an application that will be found on the path */ + {"cmd", "cmd", 0x1, 33}, + {"cmd param", "cmd", 0x1, 33}, + + /* Test an application that will not be found on the path */ + {"xyzwxyzwxyz", "", 0x1, 5}, + {"xyzwxyzwxyz param", "", 0x1, 5}, + + {NULL, NULL, 0, 0} +}; + +static void test_dde_default_app(void) +{ + char filename[MAX_PATH]; + HSZ hszApplication; + dde_thread_info_t info = { filename, GetCurrentThreadId() }; + const dde_default_app_tests_t* test; + char params[1024]; + HANDLE hThread; + MSG msg; + int rc; + + ddeInst = 0; + rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | + CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0L); + assert(rc == DMLERR_NO_ERROR); + + sprintf(filename, "%s\\test file.sde", tmpdir); + + /* It is strictly not necessary to register an application name here, but wine's + * DdeNameService implementation complains if 0L is passed instead of + * hszApplication with DNS_FILTEROFF */ + hszApplication = DdeCreateStringHandleA(ddeInst, "shlexec", CP_WINANSI); + hszTopic = DdeCreateStringHandleA(ddeInst, "shlexec", CP_WINANSI); + assert(hszApplication && hszTopic); + assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_REGISTER | DNS_FILTEROFF)); + + test = dde_default_app_tests; + while (test->command) + { + create_test_association(".sde"); + sprintf(params, test->command, tmpdir); + create_test_verb_dde(".sde", "Open", 1, params, "[test]", NULL, + "shlexec", NULL); + denyNextConnection = FALSE; + ddeApplication[0] = 0; + + /* No application will be run as we will respond to the first DDE event, + * so don't wait for it */ + SetEvent(hEvent); + + hThread = CreateThread(NULL, 0, ddeThread, (LPVOID)&info, 0, NULL); + assert(hThread); + while (GetMessage(&msg, NULL, 0, 0)) + { + /* Need a message loop for DDE server */ + TranslateMessage(&msg); + DispatchMessage(&msg); + } + rc = WaitForSingleObject(hThread, 5000); + assert(rc == WAIT_OBJECT_0); + + GetExitCodeThread(hThread, (DWORD *)&rc); + if (rc > 32) + rc=33; + if ((test->todo & 0x1)==0) + { + ok(rc==test->rc, "%s failed: rc=%d err=%d\n", shell_call, + rc, GetLastError()); + } + else todo_wine + { + ok(rc==test->rc, "%s failed: rc=%d err=%d\n", shell_call, + rc, GetLastError()); + } + if (rc == 33) + { + if ((test->todo & 0x2)==0) + { + ok(!strcmp(ddeApplication, test->expectedDdeApplication), + "Expected application '%s', got '%s'\n", + test->expectedDdeApplication, ddeApplication); + } + else todo_wine + { + ok(!strcmp(ddeApplication, test->expectedDdeApplication), + "Expected application '%s', got '%s'\n", + test->expectedDdeApplication, ddeApplication); + } + } + delete_test_association(".sde"); test++; } - assert(DdeUninitialize(inst)); + assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_UNREGISTER)); + assert(DdeFreeStringHandle(ddeInst, hszTopic)); + assert(DdeFreeStringHandle(ddeInst, hszApplication)); + assert(DdeUninitialize(ddeInst)); } static void init_test(void) @@ -1409,6 +1552,7 @@ START_TEST(shlexec) test_exes(); test_exes_long(); test_dde(); + test_dde_default_app(); cleanup_test(); }
1
0
0
0
Misha Koshelev : shell32: Fix execute_from_key to conform to native behavior.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: cfa87660a7cbc3158bfccacb4563f853ca0f2d97 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cfa87660a7cbc3158bfccacb4…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Sun May 27 20:01:01 2007 -0500 shell32: Fix execute_from_key to conform to native behavior. --- dlls/shell32/shlexec.c | 63 ++++++++++++++++-------------------------- dlls/shell32/tests/shlexec.c | 12 ++++---- 2 files changed, 30 insertions(+), 45 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index c8a4550..0d2b364 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -876,67 +876,52 @@ static UINT_PTR execute_from_key(LPWSTR key, LPCWSTR lpFile, WCHAR *env, LPCWSTR SHELL_ExecuteW32 execfunc, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out) { - WCHAR cmd[256]; - LONG cmdlen = sizeof(cmd); + static const WCHAR wCommand[] = {'c','o','m','m','a','n','d',0}; + static const WCHAR wDdeexec[] = {'d','d','e','e','x','e','c',0}; + WCHAR cmd[256], param[1024], ddeexec[256]; + LONG cmdlen = sizeof(cmd), ddeexeclen = sizeof(ddeexec); UINT_PTR retval = SE_ERR_NOASSOC; + DWORD resultLen; + LPWSTR tmp; TRACE("%s %s %s %s %s\n", debugstr_w(key), debugstr_w(lpFile), debugstr_w(env), debugstr_w(szCommandline), debugstr_w(executable_name)); cmd[0] = '\0'; + param[0] = '\0'; /* Get the application from the registry */ if (RegQueryValueW(HKEY_CLASSES_ROOT, key, cmd, &cmdlen) == ERROR_SUCCESS) { - WCHAR param[1024]; - DWORD resultLen; - TRACE("got cmd: %s\n", debugstr_w(cmd)); - param[0] = '\0'; - /* Is there a replace() function anywhere? */ cmdlen /= sizeof(WCHAR); cmd[cmdlen] = '\0'; - if (!SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline, &resultLen)) - { - /* looks like there is no %1 param in the cmd, add one */ - static const WCHAR oneW[] = { ' ','\"','%','1','\"',0 }; - strcatW(cmd, oneW); - SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline, &resultLen); - } + SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline, &resultLen); if (resultLen > sizeof(param)/sizeof(WCHAR)) ERR("Argify buffer not large enough, truncating\n"); + } + /* Get the parameters needed by the application + from the associated ddeexec key */ + tmp = strstrW(key, wCommand); + assert(tmp); + strcpyW(tmp, wDdeexec); + + if (RegQueryValueW(HKEY_CLASSES_ROOT, key, ddeexec, &ddeexeclen) == ERROR_SUCCESS) + { + TRACE("Got ddeexec %s => %s\n", debugstr_w(key), debugstr_w(ddeexec)); + if (!param[0]) strcpyW(param, executable_name); + retval = dde_connect(key, param, ddeexec, lpFile, env, szCommandline, psei->lpIDList, execfunc, psei, psei_out); + } + else if (param[0]) + { TRACE("executing: %s\n", debugstr_w(param)); retval = execfunc(param, env, FALSE, psei, psei_out); } else - { - static const WCHAR wCommand[] = {'c','o','m','m','a','n','d',0}; - static const WCHAR wDdeexec[] = {'d','d','e','e','x','e','c',0}; - LPWSTR tmp; - WCHAR param[256]; - LONG paramlen = sizeof(param); - - param[0] = '\0'; - - /* Get the parameters needed by the application - from the associated ddeexec key */ - tmp = strstrW(key, wCommand); - assert(tmp); - strcpyW(tmp, wDdeexec); - - TRACE("trying ddeexec cmd: %s\n", debugstr_w(key)); - - if (RegQueryValueW(HKEY_CLASSES_ROOT, key, param, ¶mlen) == ERROR_SUCCESS) - { - TRACE("Got ddeexec %s => %s\n", debugstr_w(key), debugstr_w(param)); - retval = dde_connect(key, executable_name, param, lpFile, env, szCommandline, psei->lpIDList, execfunc, psei, psei_out); - } - else - WARN("Nothing appropriate found for %s\n", debugstr_w(key)); - } + WARN("Nothing appropriate found for %s\n", debugstr_w(key)); return retval; } diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index ee03ed8..eabd25c 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -1082,22 +1082,22 @@ static dde_tests_t dde_tests[] = { /* Test passing and not passing command-line * argument, no DDE */ - {"", NULL, NULL, NULL, NULL, FALSE, "", 0x2, 33}, + {"", NULL, NULL, NULL, NULL, FALSE, "", 0x0, 33}, {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, "", 0x0, 33}, /* Test passing and not passing command-line * argument, with DDE */ - {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]", 0xa, 33}, - {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]", 0x8, 33}, + {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]", 0x0, 33}, + {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]", 0x0, 33}, /* Test ifexec precedence over ddeexec */ - {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]", 0xa, 33}, + {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]", 0x0, 33}, /* Test default DDE topic */ - {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]", 0xa, 33}, + {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]", 0x0, 33}, /* Test default DDE application */ - {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0xa, 33}, + {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0x1, 33}, {NULL, NULL, NULL, NULL, 0x0, 0} };
1
0
0
0
Misha Koshelev : shell32/tests: Add tests for ShellExecute DDE behavior.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: b95d0fb9c39dfe480a3025dc2346537e90a930e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b95d0fb9c39dfe480a3025dc2…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Sun May 27 20:00:52 2007 -0500 shell32/tests: Add tests for ShellExecute DDE behavior. --- dlls/shell32/tests/shlexec.c | 282 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 282 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b95d0fb9c39dfe480a302…
1
0
0
0
Alexandre Julliard : kernel32: Remove the fixme about MB_USEGLYPHCHARS.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: 2835d78d8d5ea7592bc04905db4c85c0abab728c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2835d78d8d5ea7592bc04905d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 29 23:31:35 2007 +0200 kernel32: Remove the fixme about MB_USEGLYPHCHARS. --- dlls/kernel32/locale.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 74593e5..859f30a 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -1764,7 +1764,6 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen, { const union cptable *table; int ret; - static int once; if (!src || (!dst && dstlen)) { @@ -1774,12 +1773,6 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen, if (srclen < 0) srclen = strlen(src) + 1; - if (!once && (flags & MB_USEGLYPHCHARS)) - { - once = 1; - FIXME("MB_USEGLYPHCHARS not supported\n"); - } - switch(page) { case CP_SYMBOL:
1
0
0
0
Alexandre Julliard : libwine: Add support for glyph chars mapping in OEM codepage tables.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: e6df00aa4f60f7a4c116a9a98b4ef09d82865980 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6df00aa4f60f7a4c116a9a98…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 29 23:31:14 2007 +0200 libwine: Add support for glyph chars mapping in OEM codepage tables. --- include/wine/unicode.h | 1 + libs/wine/c_037.c | 1 + libs/wine/c_10000.c | 1 + libs/wine/c_10006.c | 1 + libs/wine/c_10007.c | 1 + libs/wine/c_10029.c | 1 + libs/wine/c_1006.c | 1 + libs/wine/c_10079.c | 1 + libs/wine/c_10081.c | 1 + libs/wine/c_1026.c | 1 + libs/wine/c_1250.c | 1 + libs/wine/c_1251.c | 1 + libs/wine/c_1252.c | 1 + libs/wine/c_1253.c | 1 + libs/wine/c_1254.c | 1 + libs/wine/c_1255.c | 1 + libs/wine/c_1256.c | 1 + libs/wine/c_1257.c | 1 + libs/wine/c_1258.c | 1 + libs/wine/c_20127.c | 3 +- libs/wine/c_20866.c | 1 + libs/wine/c_21866.c | 1 + libs/wine/c_28591.c | 1 + libs/wine/c_28592.c | 1 + libs/wine/c_28593.c | 1 + libs/wine/c_28594.c | 1 + libs/wine/c_28595.c | 1 + libs/wine/c_28596.c | 1 + libs/wine/c_28597.c | 1 + libs/wine/c_28598.c | 1 + libs/wine/c_28599.c | 1 + libs/wine/c_28600.c | 1 + libs/wine/c_28603.c | 1 + libs/wine/c_28604.c | 1 + libs/wine/c_28605.c | 1 + libs/wine/c_28606.c | 1 + libs/wine/c_424.c | 1 + libs/wine/c_437.c | 36 +++++++++- libs/wine/c_500.c | 1 + libs/wine/c_737.c | 36 +++++++++- libs/wine/c_775.c | 36 +++++++++- libs/wine/c_850.c | 36 +++++++++- libs/wine/c_852.c | 36 +++++++++- libs/wine/c_855.c | 36 +++++++++- libs/wine/c_856.c | 1 + libs/wine/c_857.c | 36 +++++++++- libs/wine/c_860.c | 36 +++++++++- libs/wine/c_861.c | 36 +++++++++- libs/wine/c_862.c | 36 +++++++++- libs/wine/c_863.c | 36 +++++++++- libs/wine/c_864.c | 1 + libs/wine/c_865.c | 36 +++++++++- libs/wine/c_866.c | 36 +++++++++- libs/wine/c_869.c | 36 +++++++++- libs/wine/c_874.c | 36 +++++++++- libs/wine/c_875.c | 1 + libs/wine/c_878.c | 1 + libs/wine/cpmap.pl | 194 +++++++++++++++++++++++++++++++----------------- libs/wine/mbtowc.c | 18 ++-- 59 files changed, 703 insertions(+), 93 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e6df00aa4f60f7a4c116a…
1
0
0
0
Alexandre Julliard : wininet: Fixed compilation without SSL.
by Alexandre Julliard
30 May '07
30 May '07
Module: wine Branch: master Commit: 1ada7ba20e791c400390c314804a2541b2f3b307 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ada7ba20e791c400390c3148…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 29 23:27:08 2007 +0200 wininet: Fixed compilation without SSL. --- dlls/wininet/netconnection.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 125a90b..0a9f7ba 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -582,10 +582,11 @@ BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *avail if (!NETCON_connected(connection)) return FALSE; - if (connection->peek_msg) - *available = connection->peek_len; - else - *available = 0; + *available = 0; +#if defined HAVE_OPENSSL_SSL_H + if (connection->peek_msg) *available = connection->peek_len; +#endif + #ifdef FIONREAD if (!connection->useSSL) {
1
0
0
0
Jacek Caban : urlmon: There is no need to make slash conversion in BindToStorage as URL is already canonized in the constructor .
by Alexandre Julliard
29 May '07
29 May '07
Module: wine Branch: master Commit: 172a35c442c77e5b101be1e82102446873481d9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=172a35c442c77e5b101be1e82…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 29 03:41:12 2007 +0200 urlmon: There is no need to make slash conversion in BindToStorage as URL is already canonized in the constructor. --- dlls/urlmon/umon.c | 15 +-------------- 1 files changed, 1 insertions(+), 14 deletions(-) diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 5c795f0..b8c6bfe 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -549,7 +549,6 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, bindf = 0; hres = IBindStatusCallback_GetBindInfo(bind->pbscb, &bindf, &bi); if(SUCCEEDED(hres)) { - WCHAR *urlcopy, *tmpwc; URL_COMPONENTSW url; WCHAR *host, *path, *user, *pass; DWORD lensz = sizeof(bind->expected_size); @@ -561,24 +560,13 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, hres = IBindStatusCallback_OnStartBinding(bind->pbscb, 0, (IBinding*)bind); TRACE("OnStartBinding rets %08x\n", hres); - /* This class will accept URLs with the backslash in them. But InternetCrackURL will not - it - * requires forward slashes (this is the behaviour of Microsoft's INETAPI). So we need to make - * a copy of the URL here and change the backslash to a forward slash everywhere it appears - - * but only before any '#' or '?', after which backslash should be left alone. - */ - urlcopy = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(bind->URLName) + 1)); - lstrcpyW(urlcopy, bind->URLName); - for (tmpwc = urlcopy; *tmpwc && *tmpwc != '#' && *tmpwc != '?'; ++tmpwc) - if (*tmpwc == '\\') - *tmpwc = '/'; - bind->expected_size = 0; bind->total_read = 0; memset(&url, 0, sizeof(url)); url.dwStructSize = sizeof(url); url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = url.dwUserNameLength = url.dwPasswordLength = 1; - InternetCrackUrlW(urlcopy, 0, ICU_ESCAPE, &url); + InternetCrackUrlW(URLName, 0, ICU_ESCAPE, &url); host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1) * sizeof(WCHAR)); memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR)); host[url.dwHostNameLength] = '\0'; @@ -739,7 +727,6 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, HeapFree(GetProcessHeap(), 0, pass); HeapFree(GetProcessHeap(), 0, path); HeapFree(GetProcessHeap(), 0, host); - HeapFree(GetProcessHeap(), 0, urlcopy); } } }
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
72
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
Results per page:
10
25
50
100
200