Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
36002739
Commit
36002739
authored
Dec 10, 2003
by
Marcelo Duarte
Committed by
Alexandre Julliard
Dec 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implementation of HCR_GetExecuteCommandExW for internal use.
- New inline function __SHCloneStrAtoW.
parent
8b773b12
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
5 deletions
+51
-5
classes.c
dlls/shell32/classes.c
+29
-1
shell32_main.h
dlls/shell32/shell32_main.h
+21
-3
shlexec.c
dlls/shell32/shlexec.c
+1
-1
No files found.
dlls/shell32/classes.c
View file @
36002739
...
...
@@ -149,7 +149,7 @@ BOOL HCR_GetExecuteCommandA(LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD l
return
FALSE
;
}
BOOL
HCR_GetExecuteCommandEx
(
HKEY
hkeyClass
,
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
)
BOOL
HCR_GetExecuteCommandEx
A
(
HKEY
hkeyClass
,
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
)
{
BOOL
ret
=
FALSE
;
...
...
@@ -174,6 +174,34 @@ BOOL HCR_GetExecuteCommandEx( HKEY hkeyClass, LPCSTR szClass, LPCSTR szVerb, LPS
return
ret
;
}
BOOL
HCR_GetExecuteCommandExW
(
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
};
BOOL
ret
=
FALSE
;
TRACE
(
"%p %s %s %p
\n
"
,
hkeyClass
,
debugstr_w
(
szClass
),
debugstr_w
(
szVerb
),
szDest
);
if
(
szClass
)
RegOpenKeyExW
(
hkeyClass
,
szClass
,
0
,
0x02000000
,
&
hkeyClass
);
if
(
hkeyClass
)
{
WCHAR
sTemp
[
MAX_PATH
];
lstrcpyW
(
sTemp
,
swShell
);
lstrcatW
(
sTemp
,
szVerb
);
lstrcatW
(
sTemp
,
swCommand
);
ret
=
(
ERROR_SUCCESS
==
SHGetValueW
(
hkeyClass
,
sTemp
,
NULL
,
NULL
,
szDest
,
&
len
));
if
(
szClass
)
RegCloseKey
(
hkeyClass
);
}
TRACE
(
"-- %s
\n
"
,
debugstr_w
(
szDest
)
);
return
ret
;
}
/***************************************************************************************
* HCR_GetDefaultIcon [internal]
*
...
...
dlls/shell32/shell32_main.h
View file @
36002739
...
...
@@ -35,6 +35,7 @@
#include "shlobj.h"
#include "shellapi.h"
#include "wine/windef16.h"
#include "wine/unicode.h"
/*******************************************
* global SHELL32.DLL variables
...
...
@@ -62,6 +63,7 @@ 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_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
);
...
...
@@ -69,10 +71,10 @@ 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
);
BOOL
HCR_GetExecuteCommandEx
(
HKEY
hkeyClass
,
LPCSTR
szClass
,
LPCSTR
szVerb
,
LPSTR
szDest
,
DWORD
len
);
BOOL
HCR_GetFolderAttributes
(
REFIID
riid
,
LPDWORD
szDest
);
INT_PTR
CALLBACK
AboutDlgProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
...
...
@@ -202,8 +204,8 @@ inline static BOOL SHELL_OsIsUnicode(void)
};
inline
static
void
__SHCloneStrA
(
char
**
target
,
const
char
*
source
)
{
*
target
=
SHAlloc
(
strlen
(
source
)
+
1
);
\
strcpy
(
*
target
,
source
);
\
*
target
=
SHAlloc
(
strlen
(
source
)
+
1
);
strcpy
(
*
target
,
source
);
}
inline
static
void
__SHCloneStrWtoA
(
char
**
target
,
const
WCHAR
*
source
)
...
...
@@ -213,6 +215,20 @@ inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source)
WideCharToMultiByte
(
CP_ACP
,
0
,
source
,
-
1
,
*
target
,
len
,
NULL
,
NULL
);
}
inline
static
void
__SHCloneStrW
(
WCHAR
**
target
,
const
WCHAR
*
source
)
{
*
target
=
SHAlloc
(
(
strlenW
(
source
)
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
*
target
,
source
);
}
inline
static
WCHAR
*
__SHCloneStrAtoW
(
WCHAR
**
target
,
const
char
*
source
)
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
source
,
-
1
,
NULL
,
0
);
*
target
=
SHAlloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
source
,
-
1
,
*
target
,
len
);
return
*
target
;
}
/* handle conversions */
#define HICON_16(h32) (LOWORD(h32))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
...
...
@@ -221,5 +237,7 @@ inline static void __SHCloneStrWtoA(char ** target, const WCHAR * source)
typedef
UINT
(
*
SHELL_ExecuteA1632
)(
char
*
lpCmd
,
void
*
env
,
LPSHELLEXECUTEINFOA
sei
,
BOOL
shWait
);
BOOL
WINAPI
ShellExecuteExA32
(
LPSHELLEXECUTEINFOA
sei
,
SHELL_ExecuteA1632
execfunc
);
typedef
UINT
(
*
SHELL_ExecuteW32
)(
WCHAR
*
lpCmd
,
void
*
env
,
LPSHELLEXECUTEINFOW
sei
,
BOOL
shWait
);
BOOL
WINAPI
ShellExecuteExW32
(
LPSHELLEXECUTEINFOW
sei
,
SHELL_ExecuteW32
execfunc
);
#endif
dlls/shell32/shlexec.c
View file @
36002739
...
...
@@ -688,7 +688,7 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
/* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
/* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
if
(
sei
->
fMask
&
SEE_MASK_CLASSKEY
)
HCR_GetExecuteCommandEx
(
sei
->
hkeyClass
,
HCR_GetExecuteCommandEx
A
(
sei
->
hkeyClass
,
(
sei
->
fMask
&
SEE_MASK_CLASSNAME
)
?
sei
->
lpClass
:
NULL
,
(
sei
->
lpVerb
)
?
sei
->
lpVerb
:
"open"
,
szCommandline
,
sizeof
(
szCommandline
));
else
if
(
sei
->
fMask
&
SEE_MASK_CLASSNAME
)
...
...
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