https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dcc9a2d8f3c298401b1be…
commit dcc9a2d8f3c298401b1be40967264892b03188e3
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Oct 27 19:34:02 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Oct 27 19:34:02 2023 +0900
[SHELL32][SDK] Implement SHOpenPropSheetA (#5830)
- Add SHOpenPropSheetA and
SHOpenPropSheetW prototypes to <shlobj.h>.
- Implement SHOpenPropSheetA function.
---
dll/win32/shell32/stubs.cpp | 43 ++++++++++++++-----------------------------
dll/win32/shell32/utils.cpp | 38 ++++++++++++++++++++++++++++++++++++++
sdk/include/psdk/shlobj.h | 19 +++++++++++++++++++
3 files changed, 71 insertions(+), 29 deletions(-)
diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp
index 9ca95825c7f..ad3f31c2873 100644
--- a/dll/win32/shell32/stubs.cpp
+++ b/dll/win32/shell32/stubs.cpp
@@ -218,35 +218,20 @@ SHGetSetFolderCustomSettingsA(LPSHFOLDERCUSTOMSETTINGSA pfcs,
return E_FAIL;
}
-/*
- * Unimplemented
- */
-EXTERN_C BOOL
-WINAPI
-SHOpenPropSheetA(LPCSTR lpCaption,
- HKEY hKeys[],
- UINT uCount,
- const CLSID *pClsID,
- IDataObject *pDataObject,
- IShellBrowser *pShellBrowser,
- LPCSTR lpStartPage)
-{
- FIXME("SHOpenPropSheetA() stub\n");
- return FALSE;
-}
-
-/*
- * Unimplemented
- */
-EXTERN_C BOOL
-WINAPI
-SHOpenPropSheetW(LPCWSTR lpCaption,
- HKEY hKeys[],
- UINT uCount,
- const CLSID *pClsID,
- IDataObject *pDataObject,
- IShellBrowser *pShellBrowser,
- LPCWSTR lpStartPage)
+/*************************************************************************
+ * SHOpenPropSheetW [SHELL32.80]
+ *
+ * @see
https://learn.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shopen…
+ */
+BOOL WINAPI
+SHOpenPropSheetW(
+ _In_opt_z_ LPCWSTR pszCaption,
+ _In_opt_ HKEY *ahKeys,
+ _In_ UINT cKeys,
+ _In_ const CLSID *pclsidDefault,
+ _In_ IDataObject *pDataObject,
+ _In_opt_ IShellBrowser *pShellBrowser,
+ _In_opt_z_ LPCWSTR pszStartPage)
{
FIXME("SHOpenPropSheetW() stub\n");
return FALSE;
diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp
index f10cb11e290..c9170ff29af 100644
--- a/dll/win32/shell32/utils.cpp
+++ b/dll/win32/shell32/utils.cpp
@@ -466,3 +466,41 @@ LargeIntegerToString(
return Int64ToString(pLargeInt->QuadPart, pszOut, cchOut, bUseFormat,
pNumberFormat, dwNumberFlags);
}
+
+/*************************************************************************
+ * SHOpenPropSheetA [SHELL32.707]
+ *
+ * @see
https://learn.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shopen…
+ */
+EXTERN_C
+BOOL WINAPI
+SHOpenPropSheetA(
+ _In_opt_z_ LPCSTR pszCaption,
+ _In_opt_ HKEY *ahKeys,
+ _In_ UINT cKeys,
+ _In_ const CLSID *pclsidDefault,
+ _In_ IDataObject *pDataObject,
+ _In_opt_ IShellBrowser *pShellBrowser,
+ _In_opt_z_ LPCSTR pszStartPage)
+{
+ WCHAR szStartPageW[MAX_PATH], szCaptionW[MAX_PATH];
+ LPCWSTR pszCaptionW = NULL, pszStartPageW = NULL;
+
+ TRACE("(%s, %p, %u, %p, %p, %p, %s)", pszCaption, ahKeys, cKeys,
pclsidDefault, pDataObject,
+ pShellBrowser, pszStartPage);
+
+ if (pszCaption)
+ {
+ SHAnsiToUnicode(pszCaption, szCaptionW, _countof(szCaptionW));
+ pszCaptionW = szCaptionW;
+ }
+
+ if (pszStartPage)
+ {
+ SHAnsiToUnicode(pszStartPage, szStartPageW, _countof(szStartPageW));
+ pszStartPageW = szStartPageW;
+ }
+
+ return SHOpenPropSheetW(pszCaptionW, ahKeys, cKeys, pclsidDefault,
+ pDataObject, pShellBrowser, pszStartPageW);
+}
diff --git a/sdk/include/psdk/shlobj.h b/sdk/include/psdk/shlobj.h
index 601fd58f30c..39124f6af41 100644
--- a/sdk/include/psdk/shlobj.h
+++ b/sdk/include/psdk/shlobj.h
@@ -340,6 +340,25 @@ int WINAPI PathCleanupSpec(_In_opt_ LPCWSTR, _Inout_ LPWSTR);
HINSTANCE WINAPI SHGetShellStyleHInstance(VOID);
#endif
+BOOL WINAPI
+SHOpenPropSheetA(
+ _In_opt_z_ LPCSTR pszCaption,
+ _In_opt_ HKEY *ahKeys,
+ _In_ UINT cKeys,
+ _In_ const CLSID *pclsidDefault,
+ _In_ IDataObject *pDataObject,
+ _In_opt_ IShellBrowser *pShellBrowser,
+ _In_opt_z_ LPCSTR pszStartPage);
+BOOL WINAPI
+SHOpenPropSheetW(
+ _In_opt_z_ LPCWSTR pszCaption,
+ _In_opt_ HKEY *ahKeys,
+ _In_ UINT cKeys,
+ _In_ const CLSID *pclsidDefault,
+ _In_ IDataObject *pDataObject,
+ _In_opt_ IShellBrowser *pShellBrowser,
+ _In_opt_z_ LPCWSTR pszStartPage);
+
/*****************************************************************************
* IContextMenu interface
*/