https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81e936486ede27c51179c…
commit 81e936486ede27c51179c462aace7b84aed79c27
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Oct 28 11:38:29 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Oct 28 11:38:29 2023 +0900
[SHELL32] Implement ExtractIconResInfoA (#5846)
- Add ExtractIconResInfoA implementation.
- Add ExtractIconResInfo prototype to <undocshell.h>.
---
dll/win32/shell32/stubs.cpp | 26 ++++++--------------------
dll/win32/shell32/utils.cpp | 21 +++++++++++++++++++++
sdk/include/reactos/undocshell.h | 16 ++++++++++++++++
3 files changed, 43 insertions(+), 20 deletions(-)
diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp
index 56480aae5bd..1faf6c87977 100644
--- a/dll/win32/shell32/stubs.cpp
+++ b/dll/win32/shell32/stubs.cpp
@@ -939,26 +939,12 @@ Printers_AddPrinterPropPages(LPVOID lpUnknown1, LPVOID lpUnknown2)
*/
EXTERN_C WORD
WINAPI
-ExtractIconResInfoA(HANDLE hHandle,
- LPSTR lpFile,
- WORD wIndex,
- LPWORD lpSize,
- LPHANDLE lpIcon)
-{
- FIXME("ExtractIconResInfoA() stub\n");
- return 0;
-}
-
-/*
- * Unimplemented
- */
-EXTERN_C WORD
-WINAPI
-ExtractIconResInfoW(HANDLE hHandle,
- LPWSTR lpFile,
- WORD wIndex,
- LPWORD lpSize,
- LPHANDLE lpIcon)
+ExtractIconResInfoW(
+ _In_ HANDLE hHandle,
+ _In_ LPCWSTR lpFileName,
+ _In_ WORD wIndex,
+ _Out_ LPWORD lpSize,
+ _Out_ LPHANDLE lpIcon)
{
FIXME("ExtractIconResInfoW() stub\n");
return 0;
diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp
index 6adeca8afd7..512bd1b754f 100644
--- a/dll/win32/shell32/utils.cpp
+++ b/dll/win32/shell32/utils.cpp
@@ -65,6 +65,27 @@ PathIsSlowA(
return PathIsSlowW(strFileW, dwAttr);
}
+/*************************************************************************
+ * ExtractIconResInfoA (SHELL32.221)
+ */
+EXTERN_C
+WORD WINAPI
+ExtractIconResInfoA(
+ _In_ HANDLE hHandle,
+ _In_ LPCSTR lpFileName,
+ _In_ WORD wIndex,
+ _Out_ LPWORD lpSize,
+ _Out_ LPHANDLE lpIcon)
+{
+ TRACE("(%p, %s, %u, %p, %p)\n", hHandle, debugstr_a(lpFileName), wIndex,
lpSize, lpIcon);
+
+ if (!lpFileName)
+ return 0;
+
+ CStringW strFileNameW(lpFileName);
+ return ExtractIconResInfoW(hHandle, strFileNameW, wIndex, lpSize, lpIcon);
+}
+
/*************************************************************************
* SHOpenEffectiveToken (SHELL32.235)
*/
diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h
index 5b6953e9204..e294e8c4e54 100644
--- a/sdk/include/reactos/undocshell.h
+++ b/sdk/include/reactos/undocshell.h
@@ -239,6 +239,22 @@ HICON WINAPI SHGetFileIcon(
BOOL WINAPI FileIconInit(BOOL bFullInit);
+WORD WINAPI
+ExtractIconResInfoA(
+ _In_ HANDLE hHandle,
+ _In_ LPCSTR lpFileName,
+ _In_ WORD wIndex,
+ _Out_ LPWORD lpSize,
+ _Out_ LPHANDLE lpIcon);
+
+WORD WINAPI
+ExtractIconResInfoW(
+ _In_ HANDLE hHandle,
+ _In_ LPCWSTR lpFileName,
+ _In_ WORD wIndex,
+ _Out_ LPWORD lpSize,
+ _Out_ LPHANDLE lpIcon);
+
/****************************************************************************
* File Menu Routines
*/