Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e025c590
Commit
e025c590
authored
Jan 16, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed HCR_GetExecuteCommandW() behavior with a class name (based on a
patch by Martin Fuchs). Removed a couple of no longer used functions.
parent
e6ab6bdc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
73 deletions
+7
-73
classes.c
dlls/shell32/classes.c
+2
-62
shell32_main.h
dlls/shell32/shell32_main.h
+1
-4
shlexec.c
dlls/shell32/shlexec.c
+4
-7
No files found.
dlls/shell32/classes.c
View file @
e025c590
...
...
@@ -114,67 +114,7 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL b
}
BOOL
HCR_GetExecuteCommandW
(
LPCWSTR
szClass
,
LPCWSTR
szVerb
,
LPWSTR
szDest
,
DWORD
len
)
{
static
const
WCHAR
swShell
[]
=
{
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'\\'
,
0
};
static
const
WCHAR
swCommand
[]
=
{
'\\'
,
'c'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
0
};
WCHAR
sTemp
[
MAX_PATH
];
TRACE
(
"%s %s %p
\n
"
,
debugstr_w
(
szClass
),
debugstr_w
(
szVerb
),
szDest
);
lstrcpyW
(
sTemp
,
szClass
);
lstrcatW
(
sTemp
,
swShell
);
lstrcatW
(
sTemp
,
szVerb
);
lstrcatW
(
sTemp
,
swCommand
);
if
(
ERROR_SUCCESS
==
SHGetValueW
(
HKEY_CLASSES_ROOT
,
sTemp
,
NULL
,
NULL
,
szDest
,
&
len
))
{
TRACE
(
"-- %s
\n
"
,
debugstr_w
(
szDest
)
);
return
TRUE
;
}
return
FALSE
;
}
BOOL
HCR_GetExecuteCommandA
(
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
)
{
char
sTemp
[
MAX_PATH
];
TRACE
(
"%s %s
\n
"
,
szClass
,
szVerb
);
snprintf
(
sTemp
,
MAX_PATH
,
"%s
\\
shell
\\
%s
\\
command"
,
szClass
,
szVerb
);
if
(
ERROR_SUCCESS
==
SHGetValueA
(
HKEY_CLASSES_ROOT
,
sTemp
,
NULL
,
NULL
,
szDest
,
&
len
))
{
TRACE
(
"-- %s
\n
"
,
debugstr_a
(
szDest
)
);
return
TRUE
;
}
return
FALSE
;
}
BOOL
HCR_GetExecuteCommandExA
(
HKEY
hkeyClass
,
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
)
{
BOOL
ret
=
FALSE
;
TRACE
(
"%p %s %s
\n
"
,
hkeyClass
,
szClass
,
szVerb
);
if
(
szClass
)
RegOpenKeyExA
(
hkeyClass
,
szClass
,
0
,
0x02000000
,
&
hkeyClass
);
if
(
hkeyClass
)
{
char
sTemp
[
MAX_PATH
];
snprintf
(
sTemp
,
MAX_PATH
,
"shell
\\
%s
\\
command"
,
szVerb
);
ret
=
(
ERROR_SUCCESS
==
SHGetValueA
(
hkeyClass
,
sTemp
,
NULL
,
NULL
,
szDest
,
&
len
));
if
(
szClass
)
RegCloseKey
(
hkeyClass
);
}
TRACE
(
"-- %s
\n
"
,
szDest
);
return
ret
;
}
BOOL
HCR_GetExecuteCommandExW
(
HKEY
hkeyClass
,
LPCWSTR
szClass
,
LPCWSTR
szVerb
,
LPWSTR
szDest
,
DWORD
len
)
BOOL
HCR_GetExecuteCommandW
(
HKEY
hkeyClass
,
LPCWSTR
szClass
,
LPCWSTR
szVerb
,
LPWSTR
szDest
,
DWORD
len
)
{
static
const
WCHAR
swShell
[]
=
{
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'\\'
,
0
};
static
const
WCHAR
swCommand
[]
=
{
'\\'
,
'c'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
0
};
...
...
@@ -183,7 +123,7 @@ BOOL HCR_GetExecuteCommandExW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb,
TRACE
(
"%p %s %s %p
\n
"
,
hkeyClass
,
debugstr_w
(
szClass
),
debugstr_w
(
szVerb
),
szDest
);
if
(
szClass
)
RegOpenKeyExW
(
hkeyClass
,
szClass
,
0
,
0x02000000
,
&
hkeyClass
);
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
szClass
,
0
,
0x02000000
,
&
hkeyClass
);
if
(
hkeyClass
)
{
...
...
dlls/shell32/shell32_main.h
View file @
e025c590
...
...
@@ -62,16 +62,13 @@ INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex );
/* Classes Root */
BOOL
HCR_MapTypeToValueW
(
LPCWSTR
szExtension
,
LPWSTR
szFileType
,
DWORD
len
,
BOOL
bPrependDot
);
BOOL
HCR_GetExecuteCommandW
(
LPCWSTR
szClass
,
LPCWSTR
szVerb
,
LPWSTR
szDest
,
DWORD
len
);
BOOL
HCR_GetExecuteCommandExW
(
HKEY
hkeyClass
,
LPCWSTR
szClass
,
LPCWSTR
szVerb
,
LPWSTR
szDest
,
DWORD
len
);
BOOL
HCR_GetExecuteCommandW
(
HKEY
hkeyClass
,
LPCWSTR
szClass
,
LPCWSTR
szVerb
,
LPWSTR
szDest
,
DWORD
len
);
BOOL
HCR_GetDefaultIconW
(
LPCWSTR
szClass
,
LPWSTR
szDest
,
DWORD
len
,
LPDWORD
dwNr
);
BOOL
HCR_GetDefaultIconFromGUIDW
(
REFIID
riid
,
LPWSTR
szDest
,
DWORD
len
,
LPDWORD
dwNr
);
BOOL
HCR_GetClassNameW
(
REFIID
riid
,
LPWSTR
szDest
,
DWORD
len
);
/* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
BOOL
HCR_MapTypeToValueA
(
LPCSTR
szExtension
,
LPSTR
szFileType
,
DWORD
len
,
BOOL
bPrependDot
);
BOOL
HCR_GetExecuteCommandA
(
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
);
BOOL
HCR_GetExecuteCommandExA
(
HKEY
hkeyClass
,
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
);
BOOL
HCR_GetDefaultIconA
(
LPCSTR
szClass
,
LPSTR
szDest
,
DWORD
len
,
LPDWORD
dwNr
);
BOOL
HCR_GetClassNameA
(
REFIID
riid
,
LPSTR
szDest
,
DWORD
len
);
...
...
dlls/shell32/shlexec.c
View file @
e025c590
...
...
@@ -736,13 +736,10 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfun
/* launch a document by fileclass like 'WordPad.Document.1' */
/* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
/* FIXME: szCommandline should not be of a fixed size. Fixed to 1024, MAX_PATH is way too short! */
if
(
sei
->
fMask
&
SEE_MASK_CLASSKEY
)
HCR_GetExecuteCommandExW
(
sei
->
hkeyClass
,
(
sei
->
fMask
&
SEE_MASK_CLASSNAME
)
?
sei
->
lpClass
:
NULL
,
(
sei
->
lpVerb
)
?
sei
->
lpVerb
:
wszOpen
,
wszCommandline
,
sizeof
(
wszCommandline
)
/
sizeof
(
WCHAR
));
else
if
(
sei
->
fMask
&
SEE_MASK_CLASSNAME
)
HCR_GetExecuteCommandW
(
sei
->
lpClass
,
(
sei
->
lpVerb
)
?
sei
->
lpVerb
:
wszOpen
,
wszCommandline
,
sizeof
(
wszCommandline
)
/
sizeof
(
WCHAR
));
HCR_GetExecuteCommandW
((
sei
->
fMask
&
SEE_MASK_CLASSKEY
)
?
sei
->
hkeyClass
:
NULL
,
(
sei
->
fMask
&
SEE_MASK_CLASSNAME
)
?
sei
->
lpClass
:
NULL
,
(
sei
->
lpVerb
)
?
sei
->
lpVerb
:
wszOpen
,
wszCommandline
,
sizeof
(
wszCommandline
)
/
sizeof
(
WCHAR
));
/* FIXME: get the extension of lpFile, check if it fits to the lpClass */
TRACE
(
"SEE_MASK_CLASSNAME->'%s', doc->'%s'
\n
"
,
debugstr_w
(
wszCommandline
),
debugstr_w
(
wszApplicationName
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment