ReactOS 0.4.15-dev-7961-gdcf9eb0
com_apitest.c File Reference
#include "com_apitest.h"
#include <winreg.h>
#include <mshtmhst.h>
#include <shlwapi.h>
#include <commoncontrols.h>
#include <activscp.h>
#include <ndk/rtlfuncs.h>
#include <debug.h>
Include dependency graph for com_apitest.c:

Go to the source code of this file.

Classes

struct  _KNOWN_INTERFACE
 

Macros

#define NDEBUG
 
#define myskip(c, ...)   ((c) ? 0 : (skip(__VA_ARGS__), 1))
 
#define mytrace(...)
 
#define ID_NAME(c)   &c, #c, L ## #c
 
#define IID_ITransferAdviseSink   IID_ITransferAdviseSinkPriv
 
#define IID_IDriveFolderExt   IID_IDriveFolderExtOld
 
#define INTF_NOT_EXPOSED   LONG_MAX
 

Typedefs

typedef struct _KNOWN_INTERFACE KNOWN_INTERFACE
 
typedef const KNOWN_INTERFACEPCKNOWN_INTERFACE
 

Functions

static PCKNOWN_INTERFACE FindInterface (_In_ const IID *iid)
 
static BOOLEAN IsInterfaceExpected (_In_ PCCLASS_AND_INTERFACES class, _In_ const IID *iid)
 
static LONG GetInterfaceOffset (_In_ PUNKNOWN pUnk, _In_ const IID *iid)
 
static VOID TestModuleInterfaces (_In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
 
static VOID TestModuleRegistry (_In_ PCWSTR ModuleName, _In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
 
static VOID TestManualInstantiation (_In_ PCWSTR ModuleName, _In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
 
VOID TestClasses (_In_ PCWSTR ModuleName, _In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
 
static VOID TestInterfaceRegistry (_In_ PCKNOWN_INTERFACE Interfaces, _In_ INT InterfaceCount)
 
 START_TEST (interfaces)
 

Variables

static KNOWN_INTERFACE KnownInterfaces []
 
static const INT KnownInterfaceCount = RTL_NUMBER_OF(KnownInterfaces)
 

Macro Definition Documentation

◆ ID_NAME

#define ID_NAME (   c)    &c, #c, L ## #c

Definition at line 38 of file com_apitest.c.

◆ IID_IDriveFolderExt

#define IID_IDriveFolderExt   IID_IDriveFolderExtOld

◆ IID_ITransferAdviseSink

#define IID_ITransferAdviseSink   IID_ITransferAdviseSinkPriv

◆ INTF_NOT_EXPOSED

#define INTF_NOT_EXPOSED   LONG_MAX

Definition at line 543 of file com_apitest.c.

◆ myskip

#define myskip (   c,
  ... 
)    ((c) ? 0 : (skip(__VA_ARGS__), 1))

Definition at line 20 of file com_apitest.c.

◆ mytrace

#define mytrace (   ...)
Value:
do { \
trace(__VA_ARGS__); \
} while (0)
#define debug(msg)
Definition: key_call.c:71
int winetest_debug

Definition at line 21 of file com_apitest.c.

◆ NDEBUG

#define NDEBUG

Definition at line 17 of file com_apitest.c.

Typedef Documentation

◆ KNOWN_INTERFACE

◆ PCKNOWN_INTERFACE

Definition at line 35 of file com_apitest.c.

Function Documentation

◆ FindInterface()

static PCKNOWN_INTERFACE FindInterface ( _In_ const IID iid)
static

Definition at line 517 of file com_apitest.c.

519{
520 INT i;
521
522 for (i = 0; i < KnownInterfaceCount; i++)
523 if (IsEqualIID(KnownInterfaces[i].iid, iid))
524 return &KnownInterfaces[i];
526 return NULL;
527}
static const INT KnownInterfaceCount
Definition: com_apitest.c:513
static KNOWN_INTERFACE KnownInterfaces[]
Definition: com_apitest.c:39
#define NULL
Definition: types.h:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ASSERT(a)
Definition: mode.c:44
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
int32_t INT
Definition: typedefs.h:58

Referenced by TestModuleInterfaces().

◆ GetInterfaceOffset()

static LONG GetInterfaceOffset ( _In_ PUNKNOWN  pUnk,
_In_ const IID iid 
)
static

Definition at line 546 of file com_apitest.c.

549{
550 HRESULT hr;
551 PVOID pObj;
552 PUNKNOWN pUnk2;
553 LONG offset;
554
555 hr = IUnknown_QueryInterface(pUnk, iid, &pObj);
556 ok(hr == S_OK || hr == E_NOINTERFACE, "IUnknown::QueryInterface returned 0x%lx\n", hr);
557 if (FAILED(hr))
558 return INTF_NOT_EXPOSED;
559
560 pUnk2 = pObj;
561 offset = (LONG_PTR)pObj - (LONG_PTR)pUnk;
562 IUnknown_Release(pUnk2);
563 return offset;
564}
#define ok(value,...)
Definition: atltest.h:57
#define INTF_NOT_EXPOSED
Definition: com_apitest.c:543
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
GLintptr offset
Definition: glext.h:5920
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
long LONG
Definition: pedump.c:60
HRESULT hr
Definition: shlfolder.c:183
#define LONG_PTR
Definition: treelist.c:79
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by TestModuleInterfaces().

◆ IsInterfaceExpected()

static BOOLEAN IsInterfaceExpected ( _In_ PCCLASS_AND_INTERFACES  class,
_In_ const IID iid 
)
static

Definition at line 531 of file com_apitest.c.

534{
535 INT i;
536
537 for (i = 0; class->ifaces[i].iid; i++)
538 if (IsEqualIID(class->ifaces[i].iid, iid))
539 return TRUE;
540 return FALSE;
541}
const WCHAR * class
Definition: main.c:68
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by TestModuleInterfaces().

◆ START_TEST()

START_TEST ( interfaces  )

Definition at line 841 of file com_apitest.c.

842{
844}
static VOID TestInterfaceRegistry(_In_ PCKNOWN_INTERFACE Interfaces, _In_ INT InterfaceCount)
Definition: com_apitest.c:775

◆ TestClasses()

VOID TestClasses ( _In_ PCWSTR  ModuleName,
_In_ PCCLASS_AND_INTERFACES  ExpectedInterfaces,
_In_ INT  ExpectedInterfaceCount 
)

Definition at line 754 of file com_apitest.c.

758{
759 HRESULT hr;
760
762 ok(hr == S_OK, "CoInitializeEx failed. hr=0x%lx\n", hr);
763 if (myskip(SUCCEEDED(hr), "Failed to initialize COM. Cannot perform tests\n"))
764 return;
765
769
771}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1280
static const CLASS_AND_INTERFACES ExpectedInterfaces[]
Definition: browseui.c:13
static const INT ExpectedInterfaceCount
Definition: browseui.c:412
#define myskip(c,...)
Definition: com_apitest.c:20
static VOID TestModuleInterfaces(_In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
Definition: com_apitest.c:568
static VOID TestModuleRegistry(_In_ PCWSTR ModuleName, _In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
Definition: com_apitest.c:636
static VOID TestManualInstantiation(_In_ PCWSTR ModuleName, _In_ PCCLASS_AND_INTERFACES ExpectedInterfaces, _In_ INT ExpectedInterfaceCount)
Definition: com_apitest.c:717
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278

Referenced by START_TEST().

◆ TestInterfaceRegistry()

static VOID TestInterfaceRegistry ( _In_ PCKNOWN_INTERFACE  Interfaces,
_In_ INT  InterfaceCount 
)
static

Definition at line 775 of file com_apitest.c.

778{
779 INT i;
780 HKEY hKeyInterface;
781 LONG result;
782
783 result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Interface", 0, KEY_ENUMERATE_SUB_KEYS, &hKeyInterface);
784 ok(result == NO_ERROR, "Failed to open interface key, error %lu\n", result);
785 if (!myskip(result == NO_ERROR, "No interface key\n"))
786 {
787 for (i = 0; i < InterfaceCount; i++)
788 {
789 HKEY hKey;
791 UNICODE_STRING iid;
792 DWORD type;
793 WCHAR data[100];
795 PCKNOWN_INTERFACE iface;
796 PCWSTR expectedName;
797
798 iface = &Interfaces[i];
799 status = RtlStringFromGUID(iface->iid, &iid);
800 ok(status == STATUS_SUCCESS, "Failed to convert guid to string for %s, status %lx\n", iface->name, status);
801 if (myskip(NT_SUCCESS(status), "No guid string\n"))
802 continue;
803
804 result = RegOpenKeyExW(hKeyInterface, iid.Buffer, 0, KEY_QUERY_VALUE, &hKey);
805 if (iface->noreg)
806 {
807 ok(result == ERROR_FILE_NOT_FOUND, "RegOpenKeyEx returned %lu for %s\n", result, iface->name);
808 }
809 else
810 {
811 ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", iface->name, result);
812 (void)myskip(result == NO_ERROR, "No key\n");
813 }
815 if (result != NO_ERROR)
816 continue;
817
818 dataSize = sizeof(data);
820 ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", iface->name, result);
821 if (!myskip(result == NO_ERROR, "No module name\n"))
822 {
823 ok(type == REG_SZ, "type %lu for %s\n", type, iface->name);
824 ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, iface->name);
825 ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, iface->name);
826 ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", iface->name);
827 expectedName = wcschr(iface->wname, L'_');
828 if (expectedName)
829 expectedName++;
830 else
831 expectedName = iface->wname;
832 ok(!wcsicmp(data, expectedName), "Name is %ls, expected %ls\n", data, expectedName);
833 }
834
836 }
837 RegCloseKey(hKeyInterface);
838 }
839}
LONG NTSTATUS
Definition: precomp.h:26
#define RegCloseKey(hKey)
Definition: registry.h:49
#define NO_ERROR
Definition: dderror.h:5
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define wcschr
Definition: compat.h:17
#define wcsicmp
Definition: compat.h:15
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei dataSize
Definition: glext.h:11123
GLuint64EXT * result
Definition: glext.h:11304
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
#define REG_SZ
Definition: layer.c:22
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
BYTE * PBYTE
Definition: pedump.c:66
#define STATUS_SUCCESS
Definition: shellext.h:65
const IID * iid
Definition: com_apitest.c:30
Definition: ps.c:97
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ TestManualInstantiation()

static VOID TestManualInstantiation ( _In_ PCWSTR  ModuleName,
_In_ PCCLASS_AND_INTERFACES  ExpectedInterfaces,
_In_ INT  ExpectedInterfaceCount 
)
static

Definition at line 717 of file com_apitest.c.

721{
722 INT iClass;
725
727 ok(DllGetClassObject != NULL, "DllGetClassObject not found in %ls, error %lu\n", ModuleName, GetLastError());
728 if (myskip(DllGetClassObject != NULL, "No DllGetClassObject\n"))
729 return;
730
731 for (iClass = 0; iClass < ExpectedInterfaceCount; iClass++)
732 {
733 PVOID pv;
734 HRESULT hr;
735 class = &ExpectedInterfaces[iClass];
737 ok(hr == S_OK, "DllGetClassObject failed for %s, hr = 0x%lx\n", class->name, hr);
738 if (!myskip(SUCCEEDED(hr), "No class factory\n"))
739 {
740 IClassFactory *pCF = pv;
741 hr = IClassFactory_CreateInstance(pCF, NULL, &IID_IUnknown, &pv);
742 ok(hr == S_OK, "IClassFactory::CreateInstance failed for %s, hr = 0x%lx\n", class->name, hr);
743 if (!myskip(SUCCEEDED(hr), "No instance\n"))
744 {
745 IUnknown *pUnk = pv;
746 IUnknown_Release(pUnk);
747 }
748 IClassFactory_Release(pCF);
749 }
750 }
751}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: shsvcs.c:38
void * PVOID
Definition: typedefs.h:50
#define __stdcall
Definition: typedefs.h:25
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT
Definition: msvc.h:7

Referenced by TestClasses().

◆ TestModuleInterfaces()

static VOID TestModuleInterfaces ( _In_ PCCLASS_AND_INTERFACES  ExpectedInterfaces,
_In_ INT  ExpectedInterfaceCount 
)
static

Definition at line 568 of file com_apitest.c.

571{
572 HRESULT hr;
573 PVOID pObj;
575 INT iClass, iIntf;
577
578 for (iClass = 0; iClass < ExpectedInterfaceCount; iClass++)
579 {
580 class = &ExpectedInterfaces[iClass];
581 hr = CoCreateInstance(class->clsid,
582 NULL,
583 CLSCTX_INPROC_SERVER,
585 &pObj);
586 ok(hr == S_OK, "CoCreateInstance failed. hr=0x%lx\n", hr);
587 if (FAILED(hr))
588 {
589 skip("Failed to instantiate %s.\n", class->name);
590 continue;
591 }
592
593 pUnk = pObj;
594
595 /* Check that all expected interfaces are present and have the right offset */
596 for (iIntf = 0; class->ifaces[iIntf].iid; iIntf++)
597 {
598 PCKNOWN_INTERFACE iface = FindInterface(class->ifaces[iIntf].iid);
601 ok(0, "%s is missing %s (offset %ld)\n", class->name, iface->name, class->ifaces[iIntf].offset);
602 else if (class->ifaces[iIntf].offset != FARAWY)
603 {
604#ifdef FAIL_WRONG_OFFSET
605 ok(offset == class->ifaces[iIntf].offset, "%s, %s offset is %ld, expected %ld\n", class->name, iface->name, offset, class->ifaces[iIntf].offset);
606#else
607 if (offset != class->ifaces[iIntf].offset)
608 mytrace("%s, %s offset is %ld, expected %ld\n", class->name, iface->name, offset, class->ifaces[iIntf].offset);
609#endif
610 }
611 }
612
613 /* Check that none other than the expected interfaces are present */
614 for (iIntf = 0; iIntf < KnownInterfaceCount; iIntf++)
615 {
616 PCKNOWN_INTERFACE iface = &KnownInterfaces[iIntf];
617 LONG offset;
618 if (IsInterfaceExpected(class, iface->iid))
619 continue;
621#ifdef GENERATE_TABLE_ENTRIES
622 ok(offset == INTF_NOT_EXPOSED, "%s: { %s0x%lx, &%s },\n", class->name, offset < 0 ? "-" : "", offset < 0 ? -offset : offset, iface->name);
623#else
624 ok(offset == INTF_NOT_EXPOSED, "%s exposes %s (offset %ld), but shouldn't\n", class->name, iface->name, offset);
625#endif
626 }
627
628 // TODO: do some aggregation
629
630 IUnknown_Release(pUnk);
631 }
632}
#define skip(...)
Definition: atltest.h:64
static LONG GetInterfaceOffset(_In_ PUNKNOWN pUnk, _In_ const IID *iid)
Definition: com_apitest.c:546
static BOOLEAN IsInterfaceExpected(_In_ PCCLASS_AND_INTERFACES class, _In_ const IID *iid)
Definition: com_apitest.c:531
static PCKNOWN_INTERFACE FindInterface(_In_ const IID *iid)
Definition: com_apitest.c:517
#define mytrace(...)
Definition: com_apitest.c:21
#define FARAWY
Definition: com_apitest.h:70
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
Definition: name.c:39

Referenced by TestClasses().

◆ TestModuleRegistry()

static VOID TestModuleRegistry ( _In_ PCWSTR  ModuleName,
_In_ PCCLASS_AND_INTERFACES  ExpectedInterfaces,
_In_ INT  ExpectedInterfaceCount 
)
static

Definition at line 636 of file com_apitest.c.

640{
641 INT iClass;
643 HKEY hKeyClasses;
644 LONG result;
645
646 result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\CLSID", 0, KEY_ENUMERATE_SUB_KEYS, &hKeyClasses);
647 ok(result == NO_ERROR, "Failed to open classes key, error %lu\n", result);
648 if (!myskip(result == NO_ERROR, "No classes key\n"))
649 {
650 for (iClass = 0; iClass < ExpectedInterfaceCount; iClass++)
651 {
652 HKEY hKey;
653 HKEY hKeyServer;
656 DWORD type;
657 WCHAR data[100];
659 PCWSTR expectedThreadingModel;
660
661 class = &ExpectedInterfaces[iClass];
663 ok(status == STATUS_SUCCESS, "Failed to convert guid to string for %s, status %lx\n", class->name, status);
664 if (myskip(NT_SUCCESS(status), "No guid string\n"))
665 continue;
666
667 result = RegOpenKeyExW(hKeyClasses, clsid.Buffer, 0, KEY_ENUMERATE_SUB_KEYS, &hKey);
668 ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", class->name, result);
670 if (myskip(result == NO_ERROR, "No key\n"))
671 continue;
672
673 result = RegOpenKeyExW(hKey, L"InProcServer32", 0, KEY_QUERY_VALUE, &hKeyServer);
674 ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", class->name, result);
676 if (myskip(result == NO_ERROR, "No key\n"))
677 continue;
678
679 dataSize = sizeof(data);
680 result = RegQueryValueExW(hKeyServer, NULL, NULL, &type, (PBYTE)data, &dataSize);
681 ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", class->name, result);
682 if (!myskip(result == NO_ERROR, "No module name\n"))
683 {
684 ok(type == REG_SZ || type == REG_EXPAND_SZ, "type %lu for %s\n", type, class->name);
685 ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, class->name);
686 ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, class->name);
687 ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name);
688 // TODO: Use SearchPath (or assume everything's in system32) and do a proper full path compare
691 ok(!wcsicmp(data, ModuleName), "Server is %ls, expected %ls for %s\n", data, ModuleName, class->name);
692 }
693
694 dataSize = sizeof(data);
695 result = RegQueryValueExW(hKeyServer, L"ThreadingModel", NULL, &type, (PBYTE)data, &dataSize);
696 ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", class->name, result);
697 if (!myskip(result == NO_ERROR, "No ThreadingModel\n"))
698 {
699 ok(type == REG_SZ || type == REG_EXPAND_SZ, "type %lu for %s\n", type, class->name);
700 ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, class->name);
701 ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, class->name);
702 ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", class->name);
703 expectedThreadingModel = class->ThreadingModel;
704 if (!expectedThreadingModel)
705 expectedThreadingModel = L"Apartment";
706 ok(!wcsicmp(data, expectedThreadingModel), "Server is %ls, expected %ls for %s\n", data, expectedThreadingModel, class->name);
707 }
708
709 RegCloseKey(hKeyServer);
710 }
711 RegCloseKey(hKeyClasses);
712 }
713}
void WINAPI PathStripPathW(LPWSTR lpszPath)
Definition: path.c:694
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
REFCLSID clsid
Definition: msctf.c:82
#define REG_EXPAND_SZ
Definition: nt_native.h:1494

Referenced by TestClasses().

Variable Documentation

◆ KnownInterfaceCount

const INT KnownInterfaceCount = RTL_NUMBER_OF(KnownInterfaces)
static

Definition at line 513 of file com_apitest.c.

Referenced by FindInterface(), START_TEST(), and TestModuleInterfaces().

◆ KnownInterfaces

KNOWN_INTERFACE KnownInterfaces[]
static

Definition at line 39 of file com_apitest.c.

Referenced by FindInterface(), START_TEST(), and TestModuleInterfaces().