https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ccdd87809ba49093da9f0143bd150228bd54b4a

commit 2ccdd87809ba49093da9f0143bd150228bd54b4a
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Sat Oct 28 14:55:25 2023 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Sat Oct 28 14:55:25 2023 +0900

    [SHELL32][SDK] Implement ShortSizeFormatW (#5829)
    
    - Implement ShortSizeFormatW.
    - Add ShortSizeFormatW prototype into <undocshell.h>.
    - Modify shell32.spec.
---
 dll/win32/shell32/shell32.spec   |  2 +-
 dll/win32/shell32/stubs.cpp      | 11 -----------
 dll/win32/shell32/utils.cpp      | 13 +++++++++++++
 sdk/include/reactos/undocshell.h |  5 +++++
 4 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/dll/win32/shell32/shell32.spec b/dll/win32/shell32/shell32.spec
index 9cc8bfd8cdc..2aabb8efb2a 100644
--- a/dll/win32/shell32/shell32.spec
+++ b/dll/win32/shell32/shell32.spec
@@ -200,7 +200,7 @@
 201 stdcall -noname SHDesktopMessageLoop(ptr)
 202 stub -noname DDEHandleViewFolderNotify
 203 stdcall -noname AddCommasW(long wstr)
-204 stdcall -noname ShortSizeFormatW(double)
+204 stdcall -noname ShortSizeFormatW(long ptr)
 205 stdcall -noname Printer_LoadIconsW(wstr ptr ptr)
 206 stdcall ExtractAssociatedIconA(long str ptr)
 207 stdcall ExtractAssociatedIconExA(long str long long)
diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp
index 1faf6c87977..ee4452a9277 100644
--- a/dll/win32/shell32/stubs.cpp
+++ b/dll/win32/shell32/stubs.cpp
@@ -14,17 +14,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
-/*
- * Unimplemented
- */
-EXTERN_C LPWSTR
-WINAPI
-ShortSizeFormatW(LONGLONG llNumber)
-{
-    FIXME("ShortSizeFormatW() stub\n");
-    return NULL;
-}
-
 /*
  * Unimplemented
  */
diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp
index 512bd1b754f..215be665a6c 100644
--- a/dll/win32/shell32/utils.cpp
+++ b/dll/win32/shell32/utils.cpp
@@ -86,6 +86,19 @@ ExtractIconResInfoA(
     return ExtractIconResInfoW(hHandle, strFileNameW, wIndex, lpSize, lpIcon);
 }
 
+/*************************************************************************
+ *                ShortSizeFormatW (SHELL32.204)
+ */
+EXTERN_C
+LPWSTR WINAPI
+ShortSizeFormatW(
+    _In_ DWORD dwNumber,
+    _Out_writes_(0x8FFF) LPWSTR pszBuffer)
+{
+    TRACE("(%lu, %p)\n", dwNumber, pszBuffer);
+    return StrFormatByteSizeW(dwNumber, pszBuffer, 0x8FFF);
+}
+
 /*************************************************************************
  *                SHOpenEffectiveToken (SHELL32.235)
  */
diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h
index e294e8c4e54..a8dc8c2c145 100644
--- a/sdk/include/reactos/undocshell.h
+++ b/sdk/include/reactos/undocshell.h
@@ -700,6 +700,11 @@ LargeIntegerToString(
     _In_opt_ const NUMBERFMTW *pNumberFormat,
     _In_ DWORD dwNumberFlags);
 
+LPWSTR WINAPI
+ShortSizeFormatW(
+    _In_ DWORD dwNumber,
+    _Out_writes_(0x8FFF) LPWSTR pszBuffer);
+
 BOOL WINAPI SHOpenEffectiveToken(_Out_ LPHANDLE phToken);
 DWORD WINAPI SHGetUserSessionId(_In_opt_ HANDLE hToken);
 

Reply via email to