Skip to content

Commit 0e908da

Browse files
winesyncMishaProductions
authored andcommitted
[PROPSYS] Sync to wine-10.0
[PROPSYS] Sync to wine-10.0 [WINESYNC] propsys/tests: Merge test files. Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id d189b55d2ffb038474cb6656dc8743eb34c35a3d by Nikolay Sivov <nsivov@codeweavers.com> merge [WINESYNC] propsys: Add a semi-stub for PSCreatePropertyStoreFromObject(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47958 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id acb2e4fc7a4242c74ac91657edb97bf1e402656a by Nikolay Sivov <nsivov@codeweavers.com> [WINESYNC] propsys: Allow only ASCII digits in PSPropertyKeyFromString. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 6e8c2d836e637e1fbd83c231cfd846ecb9333964 by Jacek Caban <jacek@codeweavers.com> [WINESYNC] propsys/tests: Get rid of strcmp_wa(). Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 2340212ee9c48c731c85bbad8c81ed833458bf15 by Michael Stefaniuc <mstefani@winehq.org> [WINESYNC] propsys: Use wide-char string literals. Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id b72440fa2e1016681cbfcebcdc4792b6ced3eb53 by Michael Stefaniuc <mstefani@winehq.org> reduce wine diff and add stuff from previous commit [WINESYNC] propsys: Use --prefer_native instead of DLL_WINE_PREATTACH. Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f99113192ffac37506a905827415d3d21d0ebbf8 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] propsys: Use nameless unions. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 1d8e5079f0e53a767a783e5107f57f04c1897951 by Jacek Caban <jacek@codeweavers.com> [WINESYNC] propsys/tests: Use nameless unions. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 497de3cc19f971808ca4105f52038e61dc818db1 by Jacek Caban <jacek@codeweavers.com> push changes [WINESYNC] winecrt0: Add a default implementation for DllCanUnloadNow(). Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id bd6b53740c28c6974300e15f965c12feb0252085 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] winecrt0: Add a default implementation DllRegisterServer()/DllUnregisterServer(). Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 5d82baf9747b7b133cad3be77c0cc9e24cc09582 by Alexandre Julliard <julliard@winehq.org> [WINESYNC] propsys: Add support for VT_VECTOR|VT_UI1 type in PropVariantCompareEx(). Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id e91b05bb5be6fd70a767bea9991e818a49cc5547 by Nikolay Sivov <nsivov@codeweavers.com> [WINESYNC] propsys: Fix VT_UI4 comparison, use ulVal instead of uiVal. Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 58eeb1a86433db1104d3a9ccf9ad7435ec81443a by Rémi Bernon <rbernon@codeweavers.com> [WINESYNC] propsys/tests: Add a VT_UI4 test for PropVariantCompareEx(). A test for 58eeb1a86433db1104d3a9ccf9ad7435ec81443a. Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 10359e17ce64f39461a7b7b54f73857e6458d1fb by Nikolay Sivov <nsivov@codeweavers.com> [WINESYNC] propsys/tests: Avoid "misleading indentation" warnings. Signed-off-by: Fabian Maurer <dark.shadow4@web.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 7cd6681b3be35cf6c02f056cb5131c90c0674c16 by Fabian Maurer <dark.shadow4@web.de> [WINESYNC] propsys: Enable compilation with long types. Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id a9c797e4538a37716e62bb81c3fed3de39561b41 by Eric Pouech <eric.pouech@gmail.com> [WINESYNC] propsys/tests: Enable compilation with long types. Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id c1c393595d43bd95390d3ddf86dcbc46bc4f52ba by Eric Pouech <eric.pouech@gmail.com> add cmake changes [WINESYNC] propsys: Implement InitVariantFromFileTime. Signed-off-by: Daniel Lehman <dlehman@esri.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id f2b8ccb7b0b22b7b5d661d908f8f8ee02f22647d by Daniel Lehman <dlehman@esri.com> [WINESYNC] propsys/tests: Add some InitVariantFromFileTime tests. Signed-off-by: Daniel Lehman <dlehman@esri.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 083dea7fce4372840ac18176496a7d05dadd5ad8 by Daniel Lehman <dlehman@esri.com> [WINESYNC] propsys: Implement VariantToStringWithDefault. Signed-off-by: Mohamad Al-Jaf <mohamadaljaf@gmail.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id bf0f1fdcf80657a42116b79a0953181191cf9221 by Mohamad Al-Jaf <mohamadaljaf@gmail.com> [WINESYNC] propsys/tests: Add VariantToStringWithDefault tests. Signed-off-by: Mohamad Al-Jaf <mohamadaljaf@gmail.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 89aba13dc381dbbda62d1019e1af2af5a589b0cf by Mohamad Al-Jaf <mohamadaljaf@gmail.com> [WINESYNC] include: Add Stg functions declaration in propvarutil.h. wine commit id 0d294ad26544913414277daa164004d731ae6e33 by Biswapriyo Nath <nathbappai@gmail.com> [WINESYNC] propsys: Add InitPropVariantFromStringVector(). wine commit id 3a1146d8e63d7ceff38441fee08f7f7080527020 by Nikolay Sivov <nsivov@codeweavers.com> build fixes [WINESYNC] Remove unused NONAMELESS defines. wine commit id 20afe438320f77d103a96d1d8cd562d0899ebac7 by Alexandre Julliard <julliard@winehq.org> remove nonameless [WINESYNC] propsys: Partially implement VariantToString(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55708 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> wine commit id f7ef02bd8f74ea052d61e48cd84b226d8a5867a8 by Nikolay Sivov <nsivov@codeweavers.com> [WINESYNC] propsys: Handle VT_I4 type in VariantToString(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55708 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> wine commit id 001e0543bfd5aea060053af0c76233bb90fbb43b by Nikolay Sivov <nsivov@codeweavers.com> [WINESYNC] propsys: Implement PropVariantToUInt32WithDefault. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55713 wine commit id d177709b10ce07ddd234b0e8e00764ae4b1d8488 by Fabian Maurer <dark.shadow4@web.de> [WINESYNC] include: Use proper dllimports for propsys functions. wine commit id f0b2e0d00c86fb04d47467f39e49c587250ffec5 by Alexandre Julliard <julliard@winehq.org> fix build [WINESYNC] propsys: Remove DECLSPEC_HIDDEN usage. wine commit id e9ff53e098ef3871d692c7b907151cfbb2f0673f by Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Update propsys_private.h [WINESYNC] propsys: Force debug info in critical sections. wine commit id 67bea281cc851eda6a08430c70f6c9e848d3fbe1 by Paul Gofman <pgofman@codeweavers.com> [WINESYNC] include: Fix typos in IID_IPropertyEnumType2 and CLSID_PropertySystem. wine commit id 66e6b61705a66459ed3a9e0cf9457d8b180e4564 by Alfred Agrell <floating@muncher.se> [WINESYNC] propsys: Add stubs for variant conversion functions. wine commit id c21f04f7adaa4a8d0ca2d2659bf9a6facdc168c3 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys/tests: Add tests for VariantToPropVariant. wine commit id 8877889f2a8e36d22dcad061e6da84476efb3750 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Initially implement VariantToPropVariant. wine commit id 6985637ed59e81e7d1716095a343cc5681082306 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys/tests: Add tests for PropVariantToVariant. wine commit id 3277de5572b7f6c41ebeeb89f781e378a6a2c2d3 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys/tests: Test converting clsid to string. wine commit id 7a4f9f83c51883f41ae1363e27700452472ec18f by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Support converting clsid to string for PropVariant. wine commit id 67b097ff46c65d525de6a7f560f019de6828320c by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Initially implement PropVariantToVariant. wine commit id 808b398549350fffc9fc023d637ef8de9e4bba37 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Add PropVariantToBSTR stub. wine commit id 86558a4b83ebf9a0c6e76888a3d0f3fe3e36bf57 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys/tests: Test PropVariantToBSTR. wine commit id b4ac03f1f622120906a8b6e691caa05f6539c2dd by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys/tests: Test truncating for PropVariantToString. wine commit id df16802582a56f8076ebbcf9cb6178f65bb8b9b6 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Implement PropVariantToBSTR. wine commit id 66220be403ce5c3634c13da3546f0c19f04059cc by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Use debugstr_variant for the trace in VariantToPropVariant. wine commit id 3517aded4090229dbb11e413bde8349d1eca0be3 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys: Support converting to BSTR for PropVariantToVariant. wine commit id c33fdc27650045a754a05a8f25e250e6e72c8072 by Ziqing Hui <zhui@codeweavers.com> [WINESYNC] propsys/tests: Fix a test that fails on some Windows versions. wine commit id c09f828f43101cf2dfe11d7e13f1fc6ef4b19853 by Alexandre Julliard <julliard@winehq.org> [WINESYNC]: propsys is now in sync with wine-staging wine-10.0 build fixes Update CMakeLists.txt fix build Update propvar.c Update CMakeLists.txt Update propvar.c fix msvc build Update CMakeLists.txt Update propsys.cfg [WINESYNC]: propsys is now in sync with wine-staging wine-10.0 [propsys] Remove duplicate uuid [propsys] Fix headers/idl file
1 parent 9a9aa6f commit 0e908da

File tree

16 files changed

+1944
-845
lines changed

16 files changed

+1944
-845
lines changed

dll/win32/propsys/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
3-
add_definitions(-D__WINESRC__)
3+
remove_definitions(-D_CRT_NON_CONFORMING_SWPRINTFS -D__ROS_LONG64__)
4+
add_definitions(-D__WINESRC__ -D_PROPSYS_)
45
spec2def(propsys.dll propsys.spec ADD_IMPORTLIB)
56

67
list(APPEND SOURCE
@@ -16,7 +17,7 @@ add_library(propsys MODULE
1617
${CMAKE_CURRENT_BINARY_DIR}/propsys.def)
1718

1819
set_module_type(propsys win32dll)
19-
target_link_libraries(propsys uuid wine)
20+
target_link_libraries(propsys uuid wine wine_dll_register)
2021
add_importlibs(propsys ole32 oleaut32 msvcrt kernel32 ntdll)
2122
add_pch(propsys precomp.h SOURCE)
2223
add_cd_file(TARGET propsys DESTINATION reactos/system32 FOR all)

dll/win32/propsys/precomp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
#define COM_NO_WINDOWS_H
1010

1111
#define COBJMACROS
12-
#define NONAMELESSUNION
1312

1413
#include <windef.h>
1514
#include <winbase.h>
1615
#include <winnls.h>
1716
#include <objbase.h>
1817
#include <propsys.h>
18+
#include <oleauto.h>
19+
#include <oaidl.h>
1920

2021
#include <wine/debug.h>
2122

dll/win32/propsys/propstore.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static ULONG WINAPI PropertyStore_AddRef(IPropertyStoreCache *iface)
9292
PropertyStore *This = impl_from_IPropertyStoreCache(iface);
9393
ULONG ref = InterlockedIncrement(&This->ref);
9494

95-
TRACE("(%p) refcount=%u\n", iface, ref);
95+
TRACE("(%p) refcount=%lu\n", iface, ref);
9696

9797
return ref;
9898
}
@@ -113,7 +113,7 @@ static ULONG WINAPI PropertyStore_Release(IPropertyStoreCache *iface)
113113
PropertyStore *This = impl_from_IPropertyStoreCache(iface);
114114
ULONG ref = InterlockedDecrement(&This->ref);
115115

116-
TRACE("(%p) refcount=%u\n", iface, ref);
116+
TRACE("(%p) refcount=%lu\n", iface, ref);
117117

118118
if (ref == 0)
119119
{
@@ -159,7 +159,7 @@ static HRESULT WINAPI PropertyStore_GetAt(IPropertyStoreCache *iface,
159159
propstore_value *value;
160160
HRESULT hr;
161161

162-
TRACE("%p,%d,%p\n", iface, iProp, pkey);
162+
TRACE("%p,%ld,%p\n", iface, iProp, pkey);
163163

164164
if (!pkey)
165165
return E_POINTER;
@@ -464,7 +464,11 @@ HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv
464464

465465
This->IPropertyStoreCache_iface.lpVtbl = &PropertyStore_Vtbl;
466466
This->ref = 1;
467+
#ifdef __REACTOS__
467468
InitializeCriticalSection(&This->lock);
469+
#else
470+
InitializeCriticalSectionEx(&This->lock, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO);
471+
#endif
468472
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PropertyStore.lock");
469473
list_init(&This->formats);
470474

@@ -473,3 +477,19 @@ HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv
473477

474478
return ret;
475479
}
480+
481+
HRESULT WINAPI PSCreatePropertyStoreFromObject(IUnknown *obj, DWORD access, REFIID riid, void **ret)
482+
{
483+
HRESULT hr;
484+
485+
TRACE("(%p, %ld, %s, %p)\n", obj, access, debugstr_guid(riid), ret);
486+
487+
if (!obj || !ret)
488+
return E_POINTER;
489+
490+
if (IsEqualIID(riid, &IID_IPropertyStore) && SUCCEEDED(hr = IUnknown_QueryInterface(obj, riid, ret)))
491+
return hr;
492+
493+
FIXME("Unimplemented for %s.\n", debugstr_guid(riid));
494+
return E_NOTIMPL;
495+
}

dll/win32/propsys/propsys.spec

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
@ stub InitPropVariantFromResource
4343
@ stub InitPropVariantFromStrRet
4444
@ stub InitPropVariantFromStringAsVector
45-
@ stub InitPropVariantFromStringVector
45+
@ stdcall InitPropVariantFromStringVector(ptr long ptr)
4646
@ stub InitPropVariantFromUInt16Vector
4747
@ stub InitPropVariantFromUInt32Vector
4848
@ stub InitPropVariantFromUInt64Vector
4949
@ stub InitPropVariantVectorFromPropVariant
5050
@ stub InitVariantFromBooleanArray
5151
@ stdcall InitVariantFromBuffer(ptr long ptr)
5252
@ stub InitVariantFromDoubleArray
53-
@ stub InitVariantFromFileTime
53+
@ stdcall InitVariantFromFileTime(ptr ptr)
5454
@ stub InitVariantFromFileTimeArray
5555
@ stdcall InitVariantFromGUIDAsString(ptr ptr)
5656
@ stub InitVariantFromInt16Array
@@ -69,7 +69,7 @@
6969
@ stdcall PSCreateMemoryPropertyStore(ptr ptr)
7070
@ stub PSCreateMultiplexPropertyStore
7171
@ stub PSCreatePropertyChangeArray
72-
@ stub PSCreatePropertyStoreFromObject
72+
@ stdcall PSCreatePropertyStoreFromObject(ptr long ptr ptr)
7373
@ stub PSCreatePropertyStoreFromPropertySetStorage
7474
@ stub PSCreateSimplePropertyChange
7575
@ stub PSEnumeratePropertyDescriptions
@@ -107,7 +107,7 @@
107107
@ stub PropVariantGetUInt16Elem
108108
@ stub PropVariantGetUInt32Elem
109109
@ stub PropVariantGetUInt64Elem
110-
@ stub PropVariantToBSTR
110+
@ stdcall PropVariantToBSTR(ptr ptr)
111111
@ stdcall PropVariantToBoolean(ptr ptr)
112112
@ stub PropVariantToBooleanVector
113113
@ stub PropVariantToBooleanVectorAlloc
@@ -146,12 +146,12 @@
146146
@ stdcall PropVariantToUInt32(ptr ptr)
147147
@ stub PropVariantToUInt32Vector
148148
@ stub PropVariantToUInt32VectorAlloc
149-
@ stub PropVariantToUInt32WithDefault
149+
@ stdcall PropVariantToUInt32WithDefault(ptr long)
150150
@ stdcall PropVariantToUInt64(ptr ptr)
151151
@ stub PropVariantToUInt64Vector
152152
@ stub PropVariantToUInt64VectorAlloc
153153
@ stub PropVariantToUInt64WithDefault
154-
@ stub PropVariantToVariant
154+
@ stdcall PropVariantToVariant(ptr ptr)
155155
@ stub StgDeserializePropVariant
156156
@ stub StgSerializePropVariant
157157
@ stub VariantCompare
@@ -189,13 +189,13 @@
189189
@ stub VariantToInt64Array
190190
@ stub VariantToInt64ArrayAlloc
191191
@ stub VariantToInt64WithDefault
192-
@ stub VariantToPropVariant
192+
@ stdcall VariantToPropVariant(ptr ptr)
193193
@ stub VariantToStrRet
194-
@ stub VariantToString
194+
@ stdcall VariantToString(ptr ptr long)
195195
@ stub VariantToStringAlloc
196196
@ stub VariantToStringArray
197197
@ stub VariantToStringArrayAlloc
198-
@ stub VariantToStringWithDefault
198+
@ stdcall VariantToStringWithDefault(ptr wstr)
199199
@ stub VariantToUInt16
200200
@ stub VariantToUInt16Array
201201
@ stub VariantToUInt16ArrayAlloc

dll/win32/propsys/propsys_main.c

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
#define COBJMACROS
2323

2424
#include <stdarg.h>
25-
#ifdef __REACTOS__
26-
#include <wchar.h>
27-
#endif
2825

2926
#include "windef.h"
3027
#include "winbase.h"
@@ -37,35 +34,6 @@
3734

3835
WINE_DEFAULT_DEBUG_CHANNEL(propsys);
3936

40-
static HINSTANCE propsys_hInstance;
41-
42-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
43-
{
44-
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
45-
46-
switch (fdwReason)
47-
{
48-
case DLL_WINE_PREATTACH:
49-
return FALSE; /* prefer native version */
50-
case DLL_PROCESS_ATTACH:
51-
propsys_hInstance = hinstDLL;
52-
DisableThreadLibraryCalls(hinstDLL);
53-
break;
54-
}
55-
56-
return TRUE;
57-
}
58-
59-
HRESULT WINAPI DllRegisterServer(void)
60-
{
61-
return __wine_register_resources( propsys_hInstance );
62-
}
63-
64-
HRESULT WINAPI DllUnregisterServer(void)
65-
{
66-
return __wine_unregister_resources( propsys_hInstance );
67-
}
68-
6937
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
7038
{
7139
*ppv = NULL;
@@ -135,11 +103,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
135103
return CLASS_E_CLASSNOTAVAILABLE;
136104
}
137105

138-
HRESULT WINAPI DllCanUnloadNow(void)
139-
{
140-
return S_FALSE;
141-
}
142-
143106
static HRESULT WINAPI propsys_QueryInterface(IPropertySystem *iface, REFIID riid, void **obj)
144107
{
145108
*obj = NULL;
@@ -194,7 +157,7 @@ static HRESULT WINAPI propsys_FormatForDisplay(IPropertySystem *iface,
194157
REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags,
195158
LPWSTR dest, DWORD destlen)
196159
{
197-
FIXME("%p %p %x %p %d: stub\n", key, propvar, flags, dest, destlen);
160+
FIXME("%p %p %x %p %ld: stub\n", key, propvar, flags, dest, destlen);
198161
return E_NOTIMPL;
199162
}
200163

@@ -283,12 +246,6 @@ HRESULT WINAPI PSRefreshPropertySchema(void)
283246

284247
HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch)
285248
{
286-
static const WCHAR guid_fmtW[] = {'{','%','0','8','X','-','%','0','4','X','-',
287-
'%','0','4','X','-','%','0','2','X','%','0','2','X','-',
288-
'%','0','2','X','%','0','2','X','%','0','2','X',
289-
'%','0','2','X','%','0','2','X','%','0','2','X','}',0};
290-
static const WCHAR pid_fmtW[] = {'%','u',0};
291-
292249
WCHAR pidW[PKEY_PIDSTR_MAX + 1];
293250
LPWSTR p = psz;
294251
int len;
@@ -308,8 +265,8 @@ HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch
308265
return E_NOT_SUFFICIENT_BUFFER;
309266
}
310267

311-
swprintf(psz, guid_fmtW, pkey->fmtid.Data1, pkey->fmtid.Data2,
312-
pkey->fmtid.Data3, pkey->fmtid.Data4[0], pkey->fmtid.Data4[1],
268+
swprintf(psz, cch, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", pkey->fmtid.Data1,
269+
pkey->fmtid.Data2, pkey->fmtid.Data3, pkey->fmtid.Data4[0], pkey->fmtid.Data4[1],
313270
pkey->fmtid.Data4[2], pkey->fmtid.Data4[3], pkey->fmtid.Data4[4],
314271
pkey->fmtid.Data4[5], pkey->fmtid.Data4[6], pkey->fmtid.Data4[7]);
315272

@@ -318,7 +275,7 @@ HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch
318275
*p++ = ' ';
319276
cch -= GUIDSTRING_MAX - 1 + 1;
320277

321-
len = swprintf(pidW, pid_fmtW, pkey->pid);
278+
len = swprintf(pidW, ARRAY_SIZE(pidW), L"%u", pkey->pid);
322279

323280
if (cch >= len + 1)
324281
{
@@ -498,7 +455,7 @@ HRESULT WINAPI PSPropertyKeyFromString(LPCWSTR pszString, PROPERTYKEY *pkey)
498455
}
499456

500457
/* Overflow is not checked. */
501-
while (iswdigit(*pszString))
458+
while ('0' <= *pszString && *pszString <= '9')
502459
{
503460
pkey->pid *= 10;
504461
pkey->pid += (*pszString - '0');
@@ -517,3 +474,10 @@ HRESULT WINAPI PSCreateMemoryPropertyStore(REFIID riid, void **ppv)
517474

518475
return PropertyStore_CreateInstance(NULL, riid, ppv);
519476
}
477+
478+
#ifdef __REACTOS__
479+
HRESULT WINAPI DllCanUnloadNow(void)
480+
{
481+
return S_FALSE;
482+
}
483+
#endif

dll/win32/propsys/propsys_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020

2121
#pragma once
2222

23-
HRESULT PropertyStore_CreateInstance(IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
23+
HRESULT PropertyStore_CreateInstance(IUnknown *outer, REFIID riid, void **ppv);

0 commit comments

Comments
 (0)