#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>
Go to the source code of this file.
|
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) |
|
◆ ID_NAME
◆ IID_IDriveFolderExt
#define IID_IDriveFolderExt IID_IDriveFolderExtOld |
◆ IID_ITransferAdviseSink
#define IID_ITransferAdviseSink IID_ITransferAdviseSinkPriv |
◆ INTF_NOT_EXPOSED
◆ myskip
#define myskip |
( |
|
c, |
|
|
|
... |
|
) |
| ((c) ? 0 : (skip(__VA_ARGS__), 1)) |
◆ mytrace
Value: do { \
trace(__VA_ARGS__); \
} while (0)
Definition at line 21 of file com_apitest.c.
◆ NDEBUG
◆ KNOWN_INTERFACE
◆ PCKNOWN_INTERFACE
◆ FindInterface()
Definition at line 517 of file com_apitest.c.
519{
521
527}
static const INT KnownInterfaceCount
static KNOWN_INTERFACE KnownInterfaces[]
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
#define IsEqualIID(riid1, riid2)
Referenced by TestModuleInterfaces().
◆ GetInterfaceOffset()
Definition at line 546 of file com_apitest.c.
549{
554
555 hr = IUnknown_QueryInterface(
pUnk, iid, &pObj);
559
560 pUnk2 = pObj;
562 IUnknown_Release(pUnk2);
564}
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Referenced by TestModuleInterfaces().
◆ IsInterfaceExpected()
◆ 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)
◆ TestClasses()
Definition at line 754 of file com_apitest.c.
758{
760
762 ok(
hr ==
S_OK,
"CoInitializeEx failed. hr=0x%lx\n",
hr);
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
static const CLASS_AND_INTERFACES ExpectedInterfaces[]
static const INT ExpectedInterfaceCount
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)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
@ COINIT_APARTMENTTHREADED
Referenced by START_TEST().
◆ TestInterfaceRegistry()
Definition at line 775 of file com_apitest.c.
778{
782
786 {
787 for (
i = 0;
i < InterfaceCount;
i++)
788 {
797
798 iface = &Interfaces[
i];
802 continue;
803
806 {
808 }
809 else
810 {
813 }
816 continue;
817
822 {
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 }
838 }
839}
#define RegCloseKey(hKey)
#define NT_SUCCESS(StatCode)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
#define ERROR_FILE_NOT_FOUND
#define KEY_ENUMERATE_SUB_KEYS
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define HKEY_LOCAL_MACHINE
Referenced by START_TEST().
◆ TestManualInstantiation()
Definition at line 717 of file com_apitest.c.
721{
725
729 return;
730
732 {
737 ok(
hr ==
S_OK,
"DllGetClassObject failed for %s, hr = 0x%lx\n",
class->name,
hr);
739 {
742 ok(
hr ==
S_OK,
"IClassFactory::CreateInstance failed for %s, hr = 0x%lx\n",
class->name,
hr);
744 {
746 IUnknown_Release(
pUnk);
747 }
748 IClassFactory_Release(pCF);
749 }
750 }
751}
const GUID IID_IClassFactory
#define GetProcAddress(x, y)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
DWORD WINAPI GetLastError(void)
Referenced by TestClasses().
◆ TestModuleInterfaces()
Definition at line 568 of file com_apitest.c.
571{
577
579 {
583 CLSCTX_INPROC_SERVER,
585 &pObj);
586 ok(
hr ==
S_OK,
"CoCreateInstance failed. hr=0x%lx\n",
hr);
588 {
589 skip(
"Failed to instantiate %s.\n",
class->name);
590 continue;
591 }
592
594
595
596 for (iIntf = 0; class->ifaces[iIntf].iid; iIntf++)
597 {
601 ok(0,
"%s is missing %s (offset %ld)\n",
class->name, iface->
name,
class->ifaces[iIntf].offset);
603 {
604#ifdef FAIL_WRONG_OFFSET
606#else
609#endif
610 }
611 }
612
613
615 {
619 continue;
621#ifdef GENERATE_TABLE_ENTRIES
623#else
625#endif
626 }
627
628
629
630 IUnknown_Release(
pUnk);
631 }
632}
static LONG GetInterfaceOffset(_In_ PUNKNOWN pUnk, _In_ const IID *iid)
static BOOLEAN IsInterfaceExpected(_In_ PCCLASS_AND_INTERFACES class, _In_ const IID *iid)
static PCKNOWN_INTERFACE FindInterface(_In_ const IID *iid)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Referenced by TestClasses().
◆ TestModuleRegistry()
Definition at line 636 of file com_apitest.c.
640{
645
649 {
651 {
659 PCWSTR expectedThreadingModel;
660
665 continue;
666
671 continue;
672
677 continue;
678
683 {
688
692 }
693
698 {
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
710 }
712 }
713}
void WINAPI PathStripPathW(LPWSTR lpszPath)
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Referenced by TestClasses().
◆ KnownInterfaceCount
◆ KnownInterfaces