From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/rtl.c | 27 +++++++++++++++++++++++++++ dlls/ntdll/tests/rtl.c | 1 - include/winnt.h | 1 + 4 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 41d0500214d..1234205cf1a 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -542,6 +542,7 @@ # @ stub RtlComputeImportTableHash # @ stub RtlComputePrivatizedDllName_U @ stub RtlConsoleMultiByteToUnicodeN +@ stdcall RtlConvertDeviceFamilyInfoToString(ptr ptr ptr ptr) @ stub RtlConvertExclusiveToShared @ stdcall -arch=win32 -ret64 RtlConvertLongToLargeInteger(long) # @ stub RtlConvertPropertyToVariant diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 55b0f5b8416..8bd6d9f6b9b 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -1030,3 +1030,30 @@ void WINAPI RtlGetDeviceFamilyInfoEnum(ULONGLONG *version, DWORD *family, DWORD if (family) *family = DEVICEFAMILYINFOENUM_DESKTOP; if (form) *form = DEVICEFAMILYDEVICEFORM_UNKNOWN; } + +/********************************************************************* + * RtlConvertDeviceFamilyInfoToString [NTDLL.@] + */ +DWORD WINAPI RtlConvertDeviceFamilyInfoToString(DWORD *device_family_size, DWORD *device_form_size, + WCHAR *device_family, WCHAR *device_form) +{ + static const WCHAR *windows_desktop = L"Windows.Desktop"; + static const WCHAR *unknown_form = L"Unknown"; + DWORD family_length, form_length; + + TRACE("%p %p %p %p\n", device_family_size, device_form_size, device_family, device_form); + + family_length = (wcslen(windows_desktop) + 1) * sizeof(WCHAR); + form_length = (wcslen(unknown_form) + 1) * sizeof(WCHAR); + + if (*device_family_size < family_length || *device_form_size < form_length) + { + *device_family_size = family_length; + *device_form_size = form_length; + return STATUS_BUFFER_TOO_SMALL; + } + + memcpy(device_family, windows_desktop, family_length); + memcpy(device_form, unknown_form, form_length); + return STATUS_SUCCESS; +} diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 14ead067a37..1b262b80598 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -3940,7 +3940,6 @@ static void test_RtlConvertDeviceFamilyInfoToString(void)
if (!pRtlConvertDeviceFamilyInfoToString) { - todo_wine win_skip("RtlConvertDeviceFamilyInfoToString is unavailable.\n" ); return; } diff --git a/include/winnt.h b/include/winnt.h index 3609b55e924..55f0c396041 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6065,6 +6065,7 @@ typedef struct _TAPE_GET_MEDIA_PARAMETERS { #define DEVICEFAMILYDEVICEFORM_MAX 0x21
NTSYSAPI void WINAPI RtlGetDeviceFamilyInfoEnum(ULONGLONG*,DWORD*,DWORD*); +NTSYSAPI DWORD WINAPI RtlConvertDeviceFamilyInfoToString(DWORD *,DWORD *,WCHAR *,WCHAR *);
#define EVENTLOG_SUCCESS 0x0000 #define EVENTLOG_ERROR_TYPE 0x0001