ReactOS 0.4.15-dev-7788-g1ad9096
container.c File Reference
#include <stdio.h>
#include "wine/dxdiag.h"
#include "oleauto.h"
#include "wine/test.h"
Include dependency graph for container.c:

Go to the source code of this file.

Classes

struct  property_test
 

Macros

#define COBJMACROS
 

Functions

static const chardebugstr_variant (const VARIANT *var)
 
static BOOL create_root_IDxDiagContainer (void)
 
static void test_GetNumberOfChildContainers (void)
 
static void test_GetNumberOfProps (void)
 
static void test_EnumChildContainerNames (void)
 
static void test_GetChildContainer (void)
 
static void test_dot_parsing (void)
 
static void test_EnumPropNames (void)
 
static void test_GetProp (void)
 
static void test_root_children (void)
 
static void test_container_properties (IDxDiagContainer *container, const struct property_test *property_tests, size_t len)
 
static void test_DxDiag_SystemInfo (void)
 
static void test_DxDiag_DisplayDevices (void)
 
static void test_DxDiag_SoundDevices (void)
 
static void test_DxDiag_SoundCaptureDevices (void)
 
 START_TEST (container)
 

Variables

static IDxDiagProvider * pddp
 
static IDxDiagContainer * pddc
 
static const WCHAR DxDiag_SystemInfo [] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0}
 
static const WCHAR DxDiag_DisplayDevices [] = {'D','x','D','i','a','g','_','D','i','s','p','l','a','y','D','e','v','i','c','e','s',0}
 
static const WCHAR DxDiag_SoundDevices []
 
static const WCHAR DxDiag_SoundCaptureDevices []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file container.c.

Function Documentation

◆ create_root_IDxDiagContainer()

static BOOL create_root_IDxDiagContainer ( void  )
static

Definition at line 74 of file container.c.

75{
76 HRESULT hr;
78
79 hr = CoCreateInstance(&CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER,
80 &IID_IDxDiagProvider, (LPVOID*)&pddp);
81 if (SUCCEEDED(hr))
82 {
83 params.dwSize = sizeof(params);
84 params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION;
85 params.bAllowWHQLChecks = FALSE;
86 params.pReserved = NULL;
88 if (SUCCEEDED(hr))
89 {
91 if (SUCCEEDED(hr))
92 return TRUE;
93 }
95 }
96 return FALSE;
97}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define IDxDiagProvider_Release(p)
Definition: dxdiag.h:61
#define IDxDiagProvider_GetRootContainer(p, a)
Definition: dxdiag.h:63
#define DXDIAG_DX9_SDK_VERSION
Definition: dxdiag.h:6
#define IDxDiagProvider_Initialize(p, a, b)
Definition: dxdiag.h:62
GLenum const GLfloat * params
Definition: glext.h:5645
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static IDxDiagContainer * pddc
Definition: container.c:35
static IDxDiagProvider * pddp
Definition: container.c:34
HRESULT hr
Definition: shlfolder.c:183

Referenced by test_dot_parsing(), test_DxDiag_DisplayDevices(), test_DxDiag_SoundCaptureDevices(), test_DxDiag_SoundDevices(), test_DxDiag_SystemInfo(), test_EnumChildContainerNames(), test_EnumPropNames(), test_GetChildContainer(), test_GetNumberOfChildContainers(), test_GetNumberOfProps(), test_GetProp(), and test_root_children().

◆ debugstr_variant()

static const char * debugstr_variant ( const VARIANT var)
static

Definition at line 46 of file container.c.

47{
48 static char buf[400];
49
50 if (!var)
51 return "(null)";
52
53 switch (V_VT(var))
54 {
55 case VT_EMPTY:
56 return "{VT_EMPTY}";
57 case VT_BSTR:
58 sprintf(buf, "{VT_BSTR: %s}", wine_dbgstr_w(V_BSTR(var)));
59 break;
60 case VT_BOOL:
61 sprintf(buf, "{VT_BOOL: %x}", V_BOOL(var));
62 break;
63 case VT_UI4:
64 sprintf(buf, "{VT_UI4: %u}", V_UI4(var));
65 break;
66 default:
67 sprintf(buf, "{vt %d}", V_VT(var));
68 break;
69 }
70
71 return buf;
72}
@ VT_BSTR
Definition: compat.h:2303
@ VT_BOOL
Definition: compat.h:2306
@ VT_UI4
Definition: compat.h:2313
@ VT_EMPTY
Definition: compat.h:2295
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define wine_dbgstr_w
Definition: kernel32.h:34
#define sprintf(buf, format,...)
Definition: sprintf.c:55
const char * var
Definition: shader.c:5666
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_UI4(A)
Definition: oleauto.h:270

Referenced by AccPropServices_SetHmenuProp(), AccPropServices_SetHwndProp(), AccPropServices_SetPropValue(), CShellDispatch::BrowseForFolder(), BrowserService_GetSetCodePage(), BrowserService_OnHttpEquiv(), call_event_handlers(), check_script_safety(), class_object_GetNames(), Client_accDoDefaultAction(), Client_accLocation(), Client_accNavigate(), Client_accSelect(), Client_get_accChild(), Client_get_accDefaultAction(), Client_get_accDescription(), Client_get_accHelp(), Client_get_accHelpTopic(), Client_get_accKeyboardShortcut(), Client_get_accName(), Client_get_accRole(), Client_get_accState(), Client_get_accValue(), Client_put_accName(), Client_put_accValue(), ClOleCommandTarget_Exec(), debugstr_jsval(), dictionary_Add(), dictionary_Exists(), dictionary_get_HashVal(), dictionary_get_Item(), dictionary_put_Item(), dictionary_put_Key(), dictionary_Remove(), dispatch_event(), DispatchEx_InvokeEx(), document_write(), dump_DispParms(), Err_Raise(), exec_composesettings(), exec_copy(), exec_fontname(), exec_fontsize(), exec_forecolor(), exec_optical_zoom(), exec_print(), exec_refresh(), exec_respectvisibility_indesign(), exec_setdirty(), CShellDispatch::Explore(), function_invoke(), get_nsstyle_attr_var(), get_propput_arg(), Global_Abs(), Global_Asc(), Global_CBool(), Global_CByte(), Global_CCur(), Global_CDbl(), Global_Chr(), Global_CInt(), Global_CLng(), Global_CreateObject(), Global_CSng(), Global_CStr(), Global_Day(), Global_Fix(), Global_GetObject(), Global_Hex(), Global_Hour(), Global_InStr(), Global_InStrRev(), Global_Int(), Global_IsEmpty(), Global_IsNull(), Global_IsNumeric(), Global_IsObject(), Global_LCase(), Global_Left(), Global_Len(), Global_LTrim(), Global_Mid(), Global_Minute(), Global_Month(), Global_Oct(), Global_RGB(), Global_Right(), Global_Round(), Global_RTrim(), Global_ScriptEngine(), Global_ScriptEngineBuildVersion(), Global_ScriptEngineMajorVersion(), Global_ScriptEngineMinorVersion(), Global_Second(), Global_Sgn(), Global_Space(), Global_StrComp(), Global_StrReverse(), Global_Trim(), Global_TypeName(), Global_UBound(), Global_UCase(), Global_VarType(), Global_Year(), HTMLAttributeCollection_item(), HTMLBodyElement_put_aLink(), HTMLBodyElement_put_bgColor(), HTMLBodyElement_put_bottomMargin(), HTMLBodyElement_put_leftMargin(), HTMLBodyElement_put_link(), HTMLBodyElement_put_onbeforeunload(), HTMLBodyElement_put_onload(), HTMLBodyElement_put_onselect(), HTMLBodyElement_put_onunload(), HTMLBodyElement_put_rightMargin(), HTMLBodyElement_put_text(), HTMLBodyElement_put_topMargin(), HTMLBodyElement_put_vLink(), HTMLButtonElement_put_status(), HTMLDocument4_createEventObject(), HTMLDocument4_put_oncontrolselect(), HTMLDocument4_put_onselectionchange(), HTMLDocument5_put_onactivate(), HTMLDocument5_put_onbeforeactivate(), HTMLDocument5_put_onbeforedeactivate(), HTMLDocument5_put_ondeactivate(), HTMLDocument5_put_onfocusin(), HTMLDocument5_put_onfocusout(), HTMLDocument5_put_onmousewheel(), HTMLDocument6_put_onstorage(), HTMLDocument6_put_onstoragecommit(), HTMLDocument7_createAttributeNS(), HTMLDocument7_createElementNS(), HTMLDocument7_getElementsByTagNameNS(), HTMLDocument7_put_onabort(), HTMLDocument7_put_onblur(), HTMLDocument7_put_oncanplay(), HTMLDocument7_put_oncanplaythrough(), HTMLDocument7_put_onchange(), HTMLDocument7_put_ondrag(), HTMLDocument7_put_ondragend(), HTMLDocument7_put_ondragenter(), HTMLDocument7_put_ondragleave(), HTMLDocument7_put_ondragover(), HTMLDocument7_put_ondrop(), HTMLDocument7_put_ondurationchange(), HTMLDocument7_put_onemptied(), HTMLDocument7_put_onended(), HTMLDocument7_put_onerror(), HTMLDocument7_put_onfocus(), HTMLDocument7_put_oninput(), HTMLDocument7_put_onload(), HTMLDocument7_put_onloadeddata(), HTMLDocument7_put_onloadedmetadata(), HTMLDocument7_put_onloadstart(), HTMLDocument7_put_onmssitemodejumplistitemremoved(), HTMLDocument7_put_onmsthumbnailclick(), HTMLDocument7_put_onpause(), HTMLDocument7_put_onplay(), HTMLDocument7_put_onplaying(), HTMLDocument7_put_onprogress(), HTMLDocument7_put_onratechange(), HTMLDocument7_put_onreset(), HTMLDocument7_put_onscroll(), HTMLDocument7_put_onseekend(), HTMLDocument7_put_onseeking(), HTMLDocument7_put_onselect(), HTMLDocument7_put_onstalled(), HTMLDocument7_put_onsubmit(), HTMLDocument7_put_onsuspend(), HTMLDocument7_put_ontimeupdate(), HTMLDocument7_put_onvolumechange(), HTMLDocument7_put_onwaiting(), HTMLDocument_execCommand(), HTMLDocument_open(), HTMLDocument_put_alinkColor(), HTMLDocument_put_bgColor(), HTMLDocument_put_fgColor(), HTMLDocument_put_linkColor(), HTMLDocument_put_onafterupdate(), HTMLDocument_put_onbeforeupdate(), HTMLDocument_put_onclick(), HTMLDocument_put_ondblclick(), HTMLDocument_put_ondragstart(), HTMLDocument_put_onerrorupdate(), HTMLDocument_put_onhelp(), HTMLDocument_put_onkeydown(), HTMLDocument_put_onkeypress(), HTMLDocument_put_onkeyup(), HTMLDocument_put_onmousedown(), HTMLDocument_put_onmousemove(), HTMLDocument_put_onmouseout(), HTMLDocument_put_onmouseover(), HTMLDocument_put_onmouseup(), HTMLDocument_put_onreadystatechange(), HTMLDocument_put_onrowenter(), HTMLDocument_put_onrowexit(), HTMLDocument_put_onselectstart(), HTMLDocument_put_vlinkColor(), HTMLDOMAttribute2_insertBefore(), HTMLDOMAttribute_put_nodeValue(), HTMLDOMImplementation_hasFeature(), HTMLDOMNode_insertBefore(), HTMLDOMNode_put_nodeValue(), HTMLElement2_doScroll(), HTMLElement2_put_onblur(), HTMLElement2_put_ondrag(), HTMLElement2_put_onfocus(), HTMLElement2_put_onpaste(), HTMLElement2_put_onreadystatechange(), HTMLElement3_fireEvent(), HTMLElement3_get_disabled(), HTMLElement3_put_onactivate(), HTMLElement3_put_onbeforedeactivate(), HTMLElement3_put_oncontrolselect(), HTMLElement3_put_ondeactivate(), HTMLElement3_put_onlayoutcomplete(), HTMLElement3_put_onmousecenter(), HTMLElement3_put_onmouseleave(), HTMLElement3_put_onmove(), HTMLElement3_put_onmoveend(), HTMLElement3_put_onmovestart(), HTMLElement3_put_onpage(), HTMLElement3_put_onresizeend(), HTMLElement3_put_onresizestart(), HTMLElement4_put_onbeforeactivate(), HTMLElement4_put_onfocusin(), HTMLElement4_put_onfocusout(), HTMLElement4_put_onmousewheel(), HTMLElement_get_title(), HTMLElement_put_onafterupdate(), HTMLElement_put_onbeforeupdate(), HTMLElement_put_onclick(), HTMLElement_put_ondataavailable(), HTMLElement_put_ondatasetchanged(), HTMLElement_put_ondatasetcomplete(), HTMLElement_put_ondblclick(), HTMLElement_put_ondragstart(), HTMLElement_put_onerrorupdate(), HTMLElement_put_onfilterchange(), HTMLElement_put_onhelp(), HTMLElement_put_onkeydown(), HTMLElement_put_onkeypress(), HTMLElement_put_onkeyup(), HTMLElement_put_onmousedown(), HTMLElement_put_onmousemove(), HTMLElement_put_onmouseout(), HTMLElement_put_onmouseover(), HTMLElement_put_onmouseup(), HTMLElement_put_onrowenter(), HTMLElement_put_onrowexit(), HTMLElement_put_onselectstart(), HTMLElement_scrollIntoView(), HTMLElement_setAttribute(), HTMLElementCollection_item(), HTMLEmbedElement_put_height(), HTMLEmbedElement_put_width(), HTMLEventObj_put_returnValue(), HTMLFormElement_item(), HTMLFormElement_put_onreset(), HTMLFormElement_put_onsubmit(), HTMLFrameBase2_put_onload(), HTMLFrameBase2_put_onreadystatechange(), HTMLFrameBase_put_border(), HTMLFrameBase_put_frameSpacing(), HTMLFrameBase_put_marginHeight(), HTMLFrameBase_put_marginWidth(), HTMLIFrameElement2_put_height(), HTMLIFrameElement2_put_width(), HTMLImageElementFactory_create(), HTMLImgElement_put_onload(), HTMLInputTextElement_put_status(), HTMLLinkElement_put_onerror(), HTMLLinkElement_put_onload(), HTMLLinkElement_put_onreadystatechange(), HTMLObjectElement_put_height(), HTMLObjectElement_put_onerror(), HTMLObjectElement_put_onreadystatechange(), HTMLObjectElement_put_width(), HTMLOptionElementFactory_create(), HTMLPrivateWindow_SuperNavigate(), HTMLScriptElement_put_onerror(), HTMLSelectElement_add(), HTMLSelectElement_item(), HTMLStyle2_put_bottom(), HTMLStyle2_put_layoutGridChar(), HTMLStyle2_put_layoutGridLine(), HTMLStyle2_put_right(), HTMLStyle2_put_textKashida(), HTMLStyle3_put_scrollbar3dLightColor(), HTMLStyle3_put_scrollbarArrowColor(), HTMLStyle3_put_scrollbarBaseColor(), HTMLStyle3_put_scrollbarDarkShadowColor(), HTMLStyle3_put_scrollbarFaceColor(), HTMLStyle3_put_scrollbarHighlightColor(), HTMLStyle3_put_scrollbarShadowColor(), HTMLStyle3_put_scrollbarTrackColor(), HTMLStyle3_put_textKashidaSpace(), HTMLStyle3_put_zoom(), HTMLStyle4_put_minHeight(), HTMLStyle5_get_maxHeight(), HTMLStyle5_put_maxHeight(), HTMLStyle5_put_maxWidth(), HTMLStyle5_put_minWidth(), HTMLStyle6_put_orphans(), HTMLStyle6_put_outlineColor(), HTMLStyle6_put_outlineWidth(), HTMLStyle6_put_windows(), HTMLStyle_put_backgroundColor(), HTMLStyle_put_backgroundPositionX(), HTMLStyle_put_backgroundPositionY(), HTMLStyle_put_borderBottomColor(), HTMLStyle_put_borderBottomWidth(), HTMLStyle_put_borderLeftColor(), HTMLStyle_put_borderLeftWidth(), HTMLStyle_put_borderRightColor(), HTMLStyle_put_borderRightWidth(), HTMLStyle_put_borderTopColor(), HTMLStyle_put_borderTopWidth(), HTMLStyle_put_color(), HTMLStyle_put_fontSize(), HTMLStyle_put_height(), HTMLStyle_put_left(), HTMLStyle_put_letterSpacing(), HTMLStyle_put_lineHeight(), HTMLStyle_put_marginBottom(), HTMLStyle_put_marginLeft(), HTMLStyle_put_marginRight(), HTMLStyle_put_marginTop(), HTMLStyle_put_paddingBottom(), HTMLStyle_put_paddingLeft(), HTMLStyle_put_paddingRight(), HTMLStyle_put_paddingTop(), HTMLStyle_put_textIndent(), HTMLStyle_put_top(), HTMLStyle_put_verticalAlign(), HTMLStyle_put_width(), HTMLStyle_put_wordSpacing(), HTMLStyle_put_zIndex(), HTMLStyle_setAttribute(), HTMLStyleElement_put_onerror(), HTMLStyleElement_put_onload(), HTMLStyleElement_put_onreadystatechange(), HTMLStyleSheetsCollection_item(), HTMLTable_put_bgColor(), HTMLTable_put_border(), HTMLTable_put_borderColor(), HTMLTable_put_borderColorDark(), HTMLTable_put_borderColorLight(), HTMLTable_put_cellPadding(), HTMLTable_put_cellSpacing(), HTMLTable_put_height(), HTMLTable_put_onreadystatechange(), HTMLTable_put_width(), HTMLTableCell_put_bgColor(), HTMLTableCell_put_borderColor(), HTMLTableCell_put_borderColorDark(), HTMLTableCell_put_borderColorLight(), HTMLTableCell_put_height(), HTMLTableCell_put_width(), HTMLTableRow_put_bgColor(), HTMLTableRow_put_borderColor(), HTMLTableRow_put_borderColorDark(), HTMLTableRow_put_borderColorLight(), HTMLWindow2_item(), HTMLWindow2_put_offscreenBuffering(), HTMLWindow2_put_onbeforeunload(), HTMLWindow2_put_onblur(), HTMLWindow2_put_onerror(), HTMLWindow2_put_onfocus(), HTMLWindow2_put_onhelp(), HTMLWindow2_put_onload(), HTMLWindow2_put_onresize(), HTMLWindow2_put_onscroll(), HTMLWindow2_put_onunload(), HTMLWindow2_put_opener(), HTMLWindow2_showHelp(), HTMLWindow3_put_onafterprint(), HTMLWindow3_put_onbeforeprint(), HTMLWindow3_setTimeout(), HTMLWindow5_put_XMLHttpRequest(), HTMLWindow6_postMessage(), HTMLWindow6_put_onhashchange(), HTMLWindow6_put_onmessage(), HTMLWindow6_put_XDomainRequest(), HTMLXMLHttpRequest_open(), HTMLXMLHttpRequest_put_onreadystatechange(), HTMLXMLHttpRequest_send(), IEHTMLWindow2_item(), IEHTMLWindow2_put_offscreenBuffering(), IEHTMLWindow2_put_onbeforeunload(), IEHTMLWindow2_put_onblur(), IEHTMLWindow2_put_onerror(), IEHTMLWindow2_put_onfocus(), IEHTMLWindow2_put_onhelp(), IEHTMLWindow2_put_onload(), IEHTMLWindow2_put_onresize(), IEHTMLWindow2_put_onscroll(), IEHTMLWindow2_put_onunload(), IEHTMLWindow2_put_opener(), IEHTMLWindow2_setInterval(), IEHTMLWindow2_setTimeout(), IEHTMLWindow2_showHelp(), IEHTMLWindow2_showModalDialog(), InternetExplorer_ExecWB(), InternetExplorer_Navigate(), InternetExplorer_Navigate2(), InternetExplorer_PutProperty(), InternetExplorer_Refresh2(), InternetExplorer_ShowBrowserBar(), interp_newenum(), invoke_builtin_prop(), invoke_disp_value(), ITextRange_fnCanPaste(), ITextRange_fnMoveEndUntil(), ITextRange_fnMoveEndWhile(), ITextRange_fnMoveStartUntil(), ITextRange_fnMoveStartWhile(), ITextRange_fnMoveUntil(), ITextRange_fnMoveWhile(), ITextRange_fnPaste(), ITextSelection_fnCanPaste(), ITextSelection_fnMoveEndUntil(), ITextSelection_fnMoveEndWhile(), ITextSelection_fnMoveStartUntil(), ITextSelection_fnMoveStartWhile(), ITextSelection_fnMoveUntil(), ITextSelection_fnMoveWhile(), ITextSelection_fnPaste(), ITypeInfo_fnInvoke(), JScriptProperty_SetProperty(), MXAttributes_addAttributeFromIndex(), MXAttributes_setAttributes(), mxwriter_put_output(), CShellDispatch::NameSpace(), navigate_javascript_proc(), navigate_url(), notif_enabled(), OleControl_OnAmbientPropertyChange(), OleObject_SetClientSite(), OmHistory_back(), OmHistory_forward(), OmHistory_go(), CShellDispatch::Open(), prepare_for_binding(), PropertyBag2_Write(), PropertyBag_Write(), refresh_document(), RegExp2_Replace(), return_nscolor(), set_event_handler(), CShellDispatch::ShellExecute(), ShellUIHelper2_AddDesktopComponent(), ShellUIHelper2_AddFavourite(), ShellUIHelper2_AutoCompleteAttach(), ShellUIHelper2_AutoCompleteSaveForm(), ShellUIHelper2_AutoScan(), ShellUIHelper2_NavigateAndFind(), ShellUIHelper2_ShowBrowserUI(), stack_assume_disp(), stack_pop_bool(), stack_pop_disp(), test_container_properties(), test_xmlhttprequest(), to_boolean(), to_number(), to_object(), to_string(), typeof_string(), update_readystate(), var2str(), var_cmp(), var_to_size(), var_to_styleval(), VarAbs(), VarAdd(), VarAnd(), VarCat(), VarCmp(), VarDiv(), VarEqv(), VarFix(), VarFormat(), VarFormatCurrency(), VarFormatDateTime(), VarFormatNumber(), VarFormatPercent(), VARIANT_ClearInd(), VARIANT_Coerce(), VARIANT_DataSize(), VARIANT_FormatDate(), VARIANT_FormatNumber(), VARIANT_FormatString(), variant_to_nsastr(), variant_to_nscolor(), VariantChangeType_ChangeType(), VariantChangeTypeEx(), VariantClear(), VariantCopy(), VariantCopyInd(), VarIdiv(), VarImp(), VarInt(), VarMod(), VarMul(), VarNeg(), VarNot(), VarOr(), VarPow(), VarRound(), VarSub(), VarXor(), WBOleCommandTarget_Exec(), WebBrowser_ExecWB(), WebBrowser_GetProperty(), WebBrowser_Navigate(), WebBrowser_Navigate2(), WebBrowser_PutProperty(), WebBrowser_Refresh2(), WebBrowser_ShowBrowserBar(), WebBrowserPriv2IE9_NavigateWithBindCtx2(), Window_accDoDefaultAction(), Window_accLocation(), Window_accNavigate(), Window_accSelect(), Window_get_accChild(), Window_get_accDefaultAction(), Window_get_accDescription(), Window_get_accHelp(), Window_get_accHelpTopic(), Window_get_accKeyboardShortcut(), Window_get_accName(), Window_get_accRole(), Window_get_accState(), Window_get_accValue(), Window_put_accName(), Window_put_accValue(), window_set_timer(), winhttp_request_Open(), winhttp_request_put_Option(), winhttp_request_Send(), winhttp_request_SetProxy(), winhttp_request_WaitForResponse(), WshCollection_Item(), WshShell3_AppActivate(), WshShell3_get_Environment(), WshShell3_LogEvent(), WshShell3_Popup(), WshShell3_RegWrite(), WshShell3_Run(), xslprocessor_addParameter(), xslprocessor_put_input(), and xslprocessor_put_output().

◆ START_TEST()

START_TEST ( container  )

Definition at line 1185 of file container.c.

1186{
1194 test_GetProp();
1195
1202}
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void test_DxDiag_SoundDevices(void)
Definition: container.c:1042
static void test_DxDiag_SystemInfo(void)
Definition: container.c:831
static void test_dot_parsing(void)
Definition: container.c:337
static void test_root_children(void)
Definition: container.c:717
static void test_GetChildContainer(void)
Definition: container.c:267
static void test_GetProp(void)
Definition: container.c:574
static void test_GetNumberOfChildContainers(void)
Definition: container.c:99
static void test_EnumChildContainerNames(void)
Definition: container.c:147
static void test_DxDiag_SoundCaptureDevices(void)
Definition: container.c:1118
static void test_GetNumberOfProps(void)
Definition: container.c:124
static void test_DxDiag_DisplayDevices(void)
Definition: container.c:939
static void test_EnumPropNames(void)
Definition: container.c:434

◆ test_container_properties()

static void test_container_properties ( IDxDiagContainer *  container,
const struct property_test property_tests,
size_t  len 
)
static

Definition at line 792 of file container.c.

793{
794 HRESULT hr;
795
796 /* Check that the container has no properties if there are no properties to examine. */
797 if (len == 0)
798 {
799 DWORD prop_count;
800
802 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
803 if (hr == S_OK)
804 ok(prop_count == 0, "Expected container property count to be zero, got %u\n", prop_count);
805 }
806 else
807 {
808 VARIANT var;
809 int i;
810
812
813 /* Examine the variant types of obtained property values. */
814 for (i = 0; i < len; i++)
815 {
816 hr = IDxDiagContainer_GetProp(container, property_tests[i].prop, &var);
817 ok(hr == S_OK, "[%d] Expected IDxDiagContainer::GetProp to return S_OK for %s, got 0x%08x\n",
818 i, wine_dbgstr_w(property_tests[i].prop), hr);
819
820 if (hr == S_OK)
821 {
822 ok(V_VT(&var) == property_tests[i].vt,
823 "[%d] Expected variant type %d, got %d\n", i, property_tests[i].vt, V_VT(&var));
824 trace("%s = %s\n", wine_dbgstr_w(property_tests[i].prop), debugstr_variant(&var));
826 }
827 }
828 }
829}
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:86
#define IDxDiagContainer_GetProp(p, a, b)
Definition: dxdiag.h:72
#define IDxDiagContainer_GetNumberOfProps(p, a)
Definition: dxdiag.h:70
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
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 S_OK
Definition: intsafe.h:52
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568

Referenced by test_DxDiag_DisplayDevices(), test_DxDiag_SoundCaptureDevices(), test_DxDiag_SoundDevices(), and test_DxDiag_SystemInfo().

◆ test_dot_parsing()

static void test_dot_parsing ( void  )
static

Definition at line 337 of file container.c.

338{
339 HRESULT hr;
340 WCHAR containerbufW[256] = {0}, childbufW[256] = {0};
342 size_t i;
343 static const struct
344 {
345 const char *format;
346 const HRESULT expect;
347 } test_strings[] = {
348 { "%s.%s", S_OK },
349 { "%s.%s.", S_OK },
350 { ".%s.%s", E_INVALIDARG },
351 { "%s.%s..", E_INVALIDARG },
352 { ".%s.%s.", E_INVALIDARG },
353 { "..%s.%s", E_INVALIDARG },
354 };
355
357 {
358 skip("Unable to create the root IDxDiagContainer\n");
359 return;
360 }
361
362 /* Find a container with a child container of its own. */
364 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
365 if (FAILED(hr))
366 {
367 skip("IDxDiagContainer::GetNumberOfChildContainers failed\n");
368 goto cleanup;
369 }
370
371 for (index = 0; index < count; index++)
372 {
373 IDxDiagContainer *child;
374
375 hr = IDxDiagContainer_EnumChildContainerNames(pddc, index, containerbufW, ARRAY_SIZE(containerbufW));
376 ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
377 if (FAILED(hr))
378 {
379 skip("IDxDiagContainer::EnumChildContainerNames failed\n");
380 goto cleanup;
381 }
382
384 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
385
386 if (SUCCEEDED(hr))
387 {
388 hr = IDxDiagContainer_EnumChildContainerNames(child, 0, childbufW, ARRAY_SIZE(childbufW));
389 ok(hr == S_OK || hr == E_INVALIDARG,
390 "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr);
392
393 if (SUCCEEDED(hr))
394 break;
395 }
396 }
397
398 if (!*containerbufW || !*childbufW)
399 {
400 skip("Unable to find a suitable container\n");
401 goto cleanup;
402 }
403
404 trace("Testing IDxDiagContainer::GetChildContainer dot parsing with container %s and child container %s.\n",
405 wine_dbgstr_w(containerbufW), wine_dbgstr_w(childbufW));
406
407 for (i = 0; i < ARRAY_SIZE(test_strings); i++)
408 {
409 IDxDiagContainer *child;
410 char containerbufA[256];
411 char childbufA[256];
412 char dotbufferA[255 + 255 + 3 + 1];
413 WCHAR dotbufferW[255 + 255 + 3 + 1]; /* containerbuf + childbuf + dots + null terminator */
414
415 WideCharToMultiByte(CP_ACP, 0, containerbufW, -1, containerbufA, sizeof(containerbufA), NULL, NULL);
416 WideCharToMultiByte(CP_ACP, 0, childbufW, -1, childbufA, sizeof(childbufA), NULL, NULL);
417 sprintf(dotbufferA, test_strings[i].format, containerbufA, childbufA);
418 MultiByteToWideChar(CP_ACP, 0, dotbufferA, -1, dotbufferW, ARRAY_SIZE(dotbufferW));
419
420 trace("Trying container name %s\n", wine_dbgstr_w(dotbufferW));
422 ok(hr == test_strings[i].expect,
423 "Expected IDxDiagContainer::GetChildContainer to return 0x%08x for %s, got 0x%08x\n",
424 test_strings[i].expect, wine_dbgstr_w(dotbufferW), hr);
425 if (SUCCEEDED(hr))
427 }
428
429cleanup:
432}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
#define skip(...)
Definition: atltest.h:64
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:33
#define E_INVALIDARG
Definition: ddrawi.h:101
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
static void cleanup(void)
Definition: main.c:1335
#define IDxDiagContainer_Release(p)
Definition: dxdiag.h:66
#define IDxDiagContainer_GetChildContainer(p, a, b)
Definition: dxdiag.h:69
#define IDxDiagContainer_GetNumberOfChildContainers(p, a)
Definition: dxdiag.h:67
#define IDxDiagContainer_EnumChildContainerNames(p, a, b, c)
Definition: dxdiag.h:68
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLuint index
Definition: glext.h:6031
#define FAILED(hr)
Definition: intsafe.h:51
static BOOL create_root_IDxDiagContainer(void)
Definition: container.c:74
static HWND child
Definition: cursoricon.c:298
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ test_DxDiag_DisplayDevices()

static void test_DxDiag_DisplayDevices ( void  )
static

Definition at line 939 of file container.c.

940{
941 static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0};
942 static const WCHAR szDeviceName[] = {'s','z','D','e','v','i','c','e','N','a','m','e',0};
943 static const WCHAR szKeyDeviceID[] = {'s','z','K','e','y','D','e','v','i','c','e','I','D',0};
944 static const WCHAR szKeyDeviceKey[] = {'s','z','K','e','y','D','e','v','i','c','e','K','e','y',0};
945 static const WCHAR szVendorId[] = {'s','z','V','e','n','d','o','r','I','d',0};
946 static const WCHAR szDeviceId[] = {'s','z','D','e','v','i','c','e','I','d',0};
947 static const WCHAR szDeviceIdentifier[] = {'s','z','D','e','v','i','c','e','I','d','e','n','t','i','f','i','e','r',0};
948 static const WCHAR dwWidth[] = {'d','w','W','i','d','t','h',0};
949 static const WCHAR dwHeight[] = {'d','w','H','e','i','g','h','t',0};
950 static const WCHAR dwBpp[] = {'d','w','B','p','p',0};
951 static const WCHAR szDisplayMemoryLocalized[] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','L','o','c','a','l','i','z','e','d',0};
952 static const WCHAR szDisplayMemoryEnglish[] = {'s','z','D','i','s','p','l','a','y','M','e','m','o','r','y','E','n','g','l','i','s','h',0};
953 static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
954 static const WCHAR szDriverVersion[] = {'s','z','D','r','i','v','e','r','V','e','r','s','i','o','n',0};
955 static const WCHAR szSubSysId[] = {'s','z','S','u','b','S','y','s','I','d',0};
956 static const WCHAR szRevisionId[] = {'s','z','R','e','v','i','s','i','o','n','I','d',0};
957 static const WCHAR dwRefreshRate[] = {'d','w','R','e','f','r','e','s','h','R','a','t','e',0};
958 static const WCHAR szManufacturer[] = {'s','z','M','a','n','u','f','a','c','t','u','r','e','r',0};
959 static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0};
960 static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0};
961 static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0};
962 static const WCHAR iAdapter[] = {'i','A','d','a','p','t','e','r',0};
963
964 static const struct property_test property_tests[] =
965 {
973 {dwWidth, VT_UI4},
974 {dwHeight, VT_UI4},
975 {dwBpp, VT_UI4},
984 {b3DAccelerationExists, VT_BOOL},
985 {b3DAccelerationEnabled, VT_BOOL},
986 {bDDAccelerationEnabled, VT_BOOL},
987 {iAdapter, VT_UI4},
988 };
989
990 IDxDiagContainer *display_cont = NULL;
991 DWORD count, i;
992 HRESULT hr;
993
995 {
996 skip("Unable to create the root IDxDiagContainer\n");
997 return;
998 }
999
1001 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1002
1003 if (hr != S_OK)
1004 goto cleanup;
1005
1006 hr = IDxDiagContainer_GetNumberOfProps(display_cont, &count);
1007 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
1008 if (hr == S_OK)
1009 ok(count == 0, "Expected count to be 0, got %u\n", count);
1010
1012 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
1013
1014 if (hr != S_OK)
1015 goto cleanup;
1016
1017 for (i = 0; i < count; i++)
1018 {
1019 WCHAR child_container[256];
1020 IDxDiagContainer *child;
1021
1022 hr = IDxDiagContainer_EnumChildContainerNames(display_cont, i, child_container, ARRAY_SIZE(child_container));
1023 ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
1024
1025 hr = IDxDiagContainer_GetChildContainer(display_cont, child_container, &child);
1026 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1027
1028 if (hr == S_OK)
1029 {
1030 trace("Testing container %s\n", wine_dbgstr_w(child_container));
1031 test_container_properties(child, property_tests, ARRAY_SIZE(property_tests));
1032 }
1034 }
1035
1036cleanup:
1037 if (display_cont) IDxDiagContainer_Release(display_cont);
1040}
static const WCHAR dwBpp[]
Definition: provider.c:64
static const WCHAR szDisplayMemoryLocalized[]
Definition: provider.c:65
static const WCHAR dwWidth[]
Definition: provider.c:62
static const WCHAR szKeyDeviceID[]
Definition: provider.c:57
static const WCHAR szRevisionId[]
Definition: provider.c:72
static const WCHAR dwHeight[]
Definition: provider.c:63
static const WCHAR dwRefreshRate[]
Definition: provider.c:73
static const WCHAR szDisplayMemoryEnglish[]
Definition: provider.c:66
static const WCHAR szSubSysId[]
Definition: provider.c:71
static const WCHAR szDriverVersion[]
Definition: provider.c:70
static const WCHAR szKeyDeviceKey[]
Definition: provider.c:58
static const WCHAR szVendorId[]
Definition: provider.c:59
static const WCHAR szDeviceName[]
Definition: provider.c:56
static const WCHAR szManufacturer[]
Definition: provider.c:74
static const WCHAR szDescription[]
Definition: provider.c:55
static const WCHAR szDeviceId[]
Definition: provider.c:60
static const WCHAR iAdapter[]
Definition: provider.c:100
static const WCHAR szDeviceIdentifier[]
Definition: provider.c:61
static const WCHAR szDriverName[]
Definition: provider.c:69
static const WCHAR DxDiag_DisplayDevices[]
Definition: container.c:38
static void test_container_properties(IDxDiagContainer *container, const struct property_test *property_tests, size_t len)
Definition: container.c:792

Referenced by START_TEST().

◆ test_DxDiag_SoundCaptureDevices()

static void test_DxDiag_SoundCaptureDevices ( void  )
static

Definition at line 1118 of file container.c.

1119{
1120 static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0};
1121 static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
1122 static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
1123 static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
1124
1125 static const struct property_test property_tests[] =
1126 {
1128 {szGuidDeviceID, VT_BSTR},
1130 {szDriverPath, VT_BSTR},
1131 };
1132
1133 IDxDiagContainer *sound_cont = NULL;
1134 DWORD count, i;
1135 HRESULT hr;
1136
1138 {
1139 skip("Unable to create the root IDxDiagContainer\n");
1140 return;
1141 }
1142
1144 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1145
1146 if (hr != S_OK)
1147 goto cleanup;
1148
1150 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
1151 if (hr == S_OK)
1152 ok(count == 0, "Expected count to be 0, got %u\n", count);
1153
1155 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
1156
1157 if (hr != S_OK)
1158 goto cleanup;
1159
1160 for (i = 0; i < count; i++)
1161 {
1162 WCHAR child_container[256];
1163 IDxDiagContainer *child;
1164
1165 hr = IDxDiagContainer_EnumChildContainerNames(sound_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR));
1166 ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
1167
1168 hr = IDxDiagContainer_GetChildContainer(sound_cont, child_container, &child);
1169 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1170
1171 if (hr == S_OK)
1172 {
1173 trace("Testing container %s\n", wine_dbgstr_w(child_container));
1174 test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
1175 }
1177 }
1178
1179cleanup:
1180 if (sound_cont) IDxDiagContainer_Release(sound_cont);
1183}
static const WCHAR DxDiag_SoundCaptureDevices[]
Definition: container.c:41

Referenced by START_TEST().

◆ test_DxDiag_SoundDevices()

static void test_DxDiag_SoundDevices ( void  )
static

Definition at line 1042 of file container.c.

1043{
1044 static const WCHAR szDescription[] = {'s','z','D','e','s','c','r','i','p','t','i','o','n',0};
1045 static const WCHAR szGuidDeviceID[] = {'s','z','G','u','i','d','D','e','v','i','c','e','I','D',0};
1046 static const WCHAR szDriverPath[] = {'s','z','D','r','i','v','e','r','P','a','t','h',0};
1047 static const WCHAR szDriverName[] = {'s','z','D','r','i','v','e','r','N','a','m','e',0};
1048 static const WCHAR empty[] = {0};
1049
1050 static const struct property_test property_tests[] =
1051 {
1053 {szGuidDeviceID, VT_BSTR},
1055 {szDriverPath, VT_BSTR},
1056 };
1057
1058 IDxDiagContainer *sound_cont = NULL;
1059 DWORD count, i;
1060 HRESULT hr;
1061
1063 {
1064 skip("Unable to create the root IDxDiagContainer\n");
1065 return;
1066 }
1067
1069 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1070
1071 if (hr != S_OK)
1072 goto cleanup;
1073
1075 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
1076 if (hr == S_OK)
1077 ok(count == 0, "Expected count to be 0, got %u\n", count);
1078
1080 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
1081
1082 if (hr != S_OK)
1083 goto cleanup;
1084
1085 for (i = 0; i < count; i++)
1086 {
1087 WCHAR child_container[256];
1088 IDxDiagContainer *child, *child2;
1089
1090 hr = IDxDiagContainer_EnumChildContainerNames(sound_cont, i, child_container, sizeof(child_container)/sizeof(WCHAR));
1091 ok(hr == S_OK, "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
1092
1093 hr = IDxDiagContainer_GetChildContainer(sound_cont, child_container, &child);
1094 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1095
1096 if (hr == S_OK)
1097 {
1098 trace("Testing container %s\n", wine_dbgstr_w(child_container));
1099 test_container_properties(child, property_tests, sizeof(property_tests)/sizeof(property_tests[0]));
1100 }
1101
1102 child2 = NULL;
1104 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
1105 ok(child2 != NULL, "Expected child2 != NULL\n");
1106 ok(child2 != child, "Expected child != child2\n");
1107 if (hr == S_OK) IDxDiagContainer_Release(child2);
1108
1110 }
1111
1112cleanup:
1113 if (sound_cont) IDxDiagContainer_Release(sound_cont);
1116}
static const WCHAR empty[]
Definition: main.c:47
static const WCHAR DxDiag_SoundDevices[]
Definition: container.c:39

Referenced by START_TEST().

◆ test_DxDiag_SystemInfo()

static void test_DxDiag_SystemInfo ( void  )
static

Definition at line 831 of file container.c.

832{
833 static const WCHAR dwOSMajorVersion[] = {'d','w','O','S','M','a','j','o','r','V','e','r','s','i','o','n',0};
834 static const WCHAR dwOSMinorVersion[] = {'d','w','O','S','M','i','n','o','r','V','e','r','s','i','o','n',0};
835 static const WCHAR dwOSBuildNumber[] = {'d','w','O','S','B','u','i','l','d','N','u','m','b','e','r',0};
836 static const WCHAR dwOSPlatformID[] = {'d','w','O','S','P','l','a','t','f','o','r','m','I','D',0};
837 static const WCHAR dwDirectXVersionMajor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','a','j','o','r',0};
838 static const WCHAR dwDirectXVersionMinor[] = {'d','w','D','i','r','e','c','t','X','V','e','r','s','i','o','n','M','i','n','o','r',0};
839 static const WCHAR szDirectXVersionLetter[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','e','t','t','e','r',0};
840 static const WCHAR bDebug[] = {'b','D','e','b','u','g',0};
841 static const WCHAR bNECPC98[] = {'b','N','E','C','P','C','9','8',0};
842 static const WCHAR ullPhysicalMemory[] = {'u','l','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
843 static const WCHAR ullUsedPageFile[] = {'u','l','l','U','s','e','d','P','a','g','e','F','i','l','e',0};
844 static const WCHAR ullAvailPageFile[] = {'u','l','l','A','v','a','i','l','P','a','g','e','F','i','l','e',0};
845 static const WCHAR szWindowsDir[] = {'s','z','W','i','n','d','o','w','s','D','i','r',0};
846 static const WCHAR szCSDVersion[] = {'s','z','C','S','D','V','e','r','s','i','o','n',0};
847 static const WCHAR szDirectXVersionEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','E','n','g','l','i','s','h',0};
848 static const WCHAR szDirectXVersionLongEnglish[] = {'s','z','D','i','r','e','c','t','X','V','e','r','s','i','o','n','L','o','n','g','E','n','g','l','i','s','h',0};
849 static const WCHAR bNetMeetingRunning[] = {'b','N','e','t','M','e','e','t','i','n','g','R','u','n','n','i','n','g',0};
850 static const WCHAR szMachineNameLocalized[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','L','o','c','a','l','i','z','e','d',0};
851 static const WCHAR szMachineNameEnglish[] = {'s','z','M','a','c','h','i','n','e','N','a','m','e','E','n','g','l','i','s','h',0};
852 static const WCHAR szLanguagesLocalized[] = {'s','z','L','a','n','g','u','a','g','e','s','L','o','c','a','l','i','z','e','d',0};
853 static const WCHAR szLanguagesEnglish[] = {'s','z','L','a','n','g','u','a','g','e','s','E','n','g','l','i','s','h',0};
854 static const WCHAR szTimeLocalized[] = {'s','z','T','i','m','e','L','o','c','a','l','i','z','e','d',0};
855 static const WCHAR szTimeEnglish[] = {'s','z','T','i','m','e','E','n','g','l','i','s','h',0};
856 static const WCHAR szPhysicalMemoryEnglish[] = {'s','z','P','h','y','s','i','c','a','l','M','e','m','o','r','y','E','n','g','l','i','s','h',0};
857 static const WCHAR szPageFileLocalized[] = {'s','z','P','a','g','e','F','i','l','e','L','o','c','a','l','i','z','e','d',0};
858 static const WCHAR szPageFileEnglish[] = {'s','z','P','a','g','e','F','i','l','e','E','n','g','l','i','s','h',0};
859 static const WCHAR szOSLocalized[] = {'s','z','O','S','L','o','c','a','l','i','z','e','d',0};
860 static const WCHAR szOSExLocalized[] = {'s','z','O','S','E','x','L','o','c','a','l','i','z','e','d',0};
861 static const WCHAR szOSExLongLocalized[] = {'s','z','O','S','E','x','L','o','n','g','L','o','c','a','l','i','z','e','d',0};
862 static const WCHAR szOSEnglish[] = {'s','z','O','S','E','n','g','l','i','s','h',0};
863 static const WCHAR szOSExEnglish[] = {'s','z','O','S','E','x','E','n','g','l','i','s','h',0};
864 static const WCHAR szOSExLongEnglish[] = {'s','z','O','S','E','x','L','o','n','g','E','n','g','l','i','s','h',0};
865 static const WCHAR szProcessorEnglish[] = {'s','z','P','r','o','c','e','s','s','o','r','E','n','g','l','i','s','h',0};
866
867 static const struct property_test property_tests[] =
868 {
869 {dwOSMajorVersion, VT_UI4},
870 {dwOSMinorVersion, VT_UI4},
871 {dwOSBuildNumber, VT_UI4},
872 {dwOSPlatformID, VT_UI4},
873 {dwDirectXVersionMajor, VT_UI4},
874 {dwDirectXVersionMinor, VT_UI4},
875 {szDirectXVersionLetter, VT_BSTR},
876 {bDebug, VT_BOOL},
877 {bNECPC98, VT_BOOL},
878 {ullPhysicalMemory, VT_BSTR},
879 {ullUsedPageFile, VT_BSTR},
880 {ullAvailPageFile, VT_BSTR},
881 {szWindowsDir, VT_BSTR},
882 {szCSDVersion, VT_BSTR},
883 {szDirectXVersionEnglish, VT_BSTR},
884 {szDirectXVersionLongEnglish, VT_BSTR},
885 {bNetMeetingRunning, VT_BOOL},
886 {szMachineNameLocalized, VT_BSTR},
887 {szMachineNameEnglish, VT_BSTR},
888 {szLanguagesLocalized, VT_BSTR},
889 {szLanguagesEnglish, VT_BSTR},
890 {szTimeLocalized, VT_BSTR},
891 {szTimeEnglish, VT_BSTR},
892 {szPhysicalMemoryEnglish, VT_BSTR},
893 {szPageFileLocalized, VT_BSTR},
894 {szPageFileEnglish, VT_BSTR},
895 {szOSLocalized, VT_BSTR},
896 {szOSExLocalized, VT_BSTR},
897 {szOSExLongLocalized, VT_BSTR},
898 {szOSEnglish, VT_BSTR},
899 {szOSExEnglish, VT_BSTR},
900 {szOSExLongEnglish, VT_BSTR},
901 {szProcessorEnglish, VT_BSTR},
902 };
903
904 IDxDiagContainer *container, *container2;
905 static const WCHAR empty[] = {0};
906 HRESULT hr;
907
909 {
910 skip("Unable to create the root IDxDiagContainer\n");
911 return;
912 }
913
915 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
916
918 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
919
920 if (hr == S_OK)
921 {
922 trace("Testing container DxDiag_SystemInfo\n");
923 test_container_properties(container, property_tests, ARRAY_SIZE(property_tests));
924
925 container2 = NULL;
927 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
928 ok(container2 != NULL, "Expected container2 != NULL\n");
929 ok(container2 != container, "Expected container != container2\n");
930 if (hr == S_OK) IDxDiagContainer_Release(container2);
931
933 }
934
937}
BOOL bDebug
Definition: service.c:37
static const WCHAR DxDiag_SystemInfo[]
Definition: container.c:37

Referenced by START_TEST().

◆ test_EnumChildContainerNames()

static void test_EnumChildContainerNames ( void  )
static

Definition at line 147 of file container.c.

148{
149 HRESULT hr;
150 WCHAR container[256];
151 DWORD maxcount, index;
152 static const WCHAR testW[] = {'t','e','s','t',0};
153 static const WCHAR zerotestW[] = {0,'e','s','t',0};
154
156 {
157 skip("Unable to create the root IDxDiagContainer\n");
158 return;
159 }
160
161 /* Test various combinations of invalid parameters. */
163 ok(hr == E_INVALIDARG,
164 "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
165
167 ok(hr == E_INVALIDARG,
168 "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
169
170 /* Test the conditions in which the output buffer can be modified. */
171 memcpy(container, testW, sizeof(testW));
173 ok(hr == E_INVALIDARG,
174 "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
175 ok(!memcmp(container, testW, sizeof(testW)),
176 "Expected the container buffer to be untouched, got %s\n", wine_dbgstr_w(container));
177
178 memcpy(container, testW, sizeof(testW));
180 ok(hr == E_INVALIDARG,
181 "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
182 ok(!memcmp(container, testW, sizeof(testW)),
183 "Expected the container buffer to be untouched, got %s\n", wine_dbgstr_w(container));
184
185 memcpy(container, testW, sizeof(testW));
187 ok(hr == E_INVALIDARG,
188 "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG, got 0x%08x\n", hr);
189 ok(!memcmp(container, zerotestW, sizeof(zerotestW)),
190 "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container));
191
193 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
194 if (FAILED(hr))
195 {
196 skip("IDxDiagContainer::GetNumberOfChildContainers failed\n");
197 goto cleanup;
198 }
199
200 trace("Starting child container enumeration of the root container:\n");
201
202 /* We should be able to enumerate as many child containers as the value
203 * that IDxDiagContainer::GetNumberOfChildContainers returns. */
204 for (index = 0; index <= maxcount; index++)
205 {
206 /* A buffer size of 1 is unlikely to be valid, as only a null terminator
207 * could be stored, and it is unlikely that a container name could be empty. */
208 DWORD buffersize = 1;
209 memcpy(container, testW, sizeof(testW));
211 if (hr == E_INVALIDARG)
212 {
213 /* We should get here when index is one more than the maximum index value. */
214 ok(maxcount == index,
215 "Expected IDxDiagContainer::EnumChildContainerNames to return E_INVALIDARG "
216 "on the last index %d, got 0x%08x\n", index, hr);
217 ok(container[0] == '\0',
218 "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container));
219 break;
220 }
222 {
223 WCHAR temp[256];
224
225 ok(container[0] == '\0',
226 "Expected the container buffer string to be empty, got %s\n", wine_dbgstr_w(container));
227
228 /* Get the container name to compare against. */
230 ok(hr == S_OK,
231 "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
232
233 /* Show that the DirectX SDK's stipulation that the buffer be at
234 * least 256 characters long is a mere suggestion, and smaller sizes
235 * can be acceptable also. IDxDiagContainer::EnumChildContainerNames
236 * doesn't provide a way of getting the exact size required, so the
237 * buffersize value will be iterated to at most 256 characters. */
238 for (buffersize = 2; buffersize <= 256; buffersize++)
239 {
240 memcpy(container, testW, sizeof(testW));
243 break;
244
245 ok(!memcmp(temp, container, sizeof(WCHAR)*(buffersize - 1)),
246 "Expected truncated container name string, got %s\n", wine_dbgstr_w(container));
247 }
248
249 ok(hr == S_OK,
250 "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, "
251 "got hr = 0x%08x, buffersize = %d\n", hr, buffersize);
252 if (hr == S_OK)
253 trace("pddc[%d] = %s, length = %d\n", index, wine_dbgstr_w(container), buffersize);
254 }
255 else
256 {
257 ok(0, "IDxDiagContainer::EnumChildContainerNames unexpectedly returned 0x%08x\n", hr);
258 break;
259 }
260 }
261
262cleanup:
265}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define DXDIAG_E_INSUFFICIENT_BUFFER
Definition: dxdiag.h:57
static const WCHAR testW[]
Definition: jsregexp.c:44
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by START_TEST().

◆ test_EnumPropNames()

static void test_EnumPropNames ( void  )
static

Definition at line 434 of file container.c.

435{
436 HRESULT hr;
437 WCHAR container[256], property[256];
438 IDxDiagContainer *child = NULL;
439 DWORD count, index, propcount;
440 static const WCHAR testW[] = {'t','e','s','t',0};
441
443 {
444 skip("Unable to create the root IDxDiagContainer\n");
445 return;
446 }
447
448 /* Find a container with a non-zero number of properties. */
450 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
451 if (FAILED(hr))
452 {
453 skip("IDxDiagContainer::GetNumberOfChildContainers failed\n");
454 goto cleanup;
455 }
456
457 for (index = 0; index < count; index++)
458 {
460 ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
461 if (FAILED(hr))
462 {
463 skip("IDxDiagContainer::EnumChildContainerNames failed\n");
464 goto cleanup;
465 }
466
468 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
469
470 if (SUCCEEDED(hr))
471 {
473 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
474
475 if (!propcount)
476 {
478 child = NULL;
479 }
480 else
481 break;
482 }
483 }
484
485 if (!child)
486 {
487 skip("Unable to find a container with non-zero property count\n");
488 goto cleanup;
489 }
490
492 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr);
493
494 memcpy(property, testW, sizeof(testW));
496 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr);
497 ok(!memcmp(property, testW, sizeof(testW)),
498 "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property));
499
500 memcpy(property, testW, sizeof(testW));
502 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG, got 0x%08x\n", hr);
503 ok(!memcmp(property, testW, sizeof(testW)),
504 "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property));
505
506 trace("Starting property enumeration of the %s container:\n", wine_dbgstr_w(container));
507
508 /* We should be able to enumerate as many properties as the value that
509 * IDxDiagContainer::GetNumberOfProps returns. */
510 for (index = 0; index <= propcount; index++)
511 {
512 /* A buffer size of 1 is unlikely to be valid, as only a null terminator
513 * could be stored, and it is unlikely that a property name could be empty. */
514 DWORD buffersize = 1;
515
516 memcpy(property, testW, sizeof(testW));
518 if (hr == E_INVALIDARG)
519 {
520 /* We should get here when index is one more than the maximum index value. */
521 ok(propcount == index,
522 "Expected IDxDiagContainer::EnumPropNames to return E_INVALIDARG "
523 "on the last index %d, got 0x%08x\n", index, hr);
524 ok(!memcmp(property, testW, sizeof(testW)),
525 "Expected the property buffer to be unchanged, got %s\n", wine_dbgstr_w(property));
526 break;
527 }
529 {
530 WCHAR temp[256];
531
532 ok(property[0] == '\0',
533 "Expected the property buffer string to be empty, got %s\n", wine_dbgstr_w(property));
535 ok(hr == S_OK,
536 "Expected IDxDiagContainer::EnumPropNames to return S_OK, got 0x%08x\n", hr);
537
538 /* Show that the DirectX SDK's stipulation that the buffer be at
539 * least 256 characters long is a mere suggestion, and smaller sizes
540 * can be acceptable also. IDxDiagContainer::EnumPropNames doesn't
541 * provide a way of getting the exact size required, so the buffersize
542 * value will be iterated to at most 256 characters. */
543 for (buffersize = 2; buffersize <= 256; buffersize++)
544 {
545 memcpy(property, testW, sizeof(testW));
548 break;
549
550 ok(!memcmp(temp, property, sizeof(WCHAR)*(buffersize - 1)),
551 "Expected truncated property name string, got %s\n", wine_dbgstr_w(property));
552 }
553
554 ok(hr == S_OK,
555 "Expected IDxDiagContainer::EnumPropNames to return S_OK, "
556 "got hr = 0x%08x, buffersize = %d\n", hr, buffersize);
557 if (hr == S_OK)
558 trace("child[%d] = %s, length = %d\n", index, wine_dbgstr_w(property), buffersize);
559 }
560 else
561 {
562 ok(0, "IDxDiagContainer::EnumPropNames unexpectedly returned 0x%08x\n", hr);
563 break;
564 }
565 }
566
568
569cleanup:
572}
#define IDxDiagContainer_EnumPropNames(p, a, b, c)
Definition: dxdiag.h:101

Referenced by START_TEST().

◆ test_GetChildContainer()

static void test_GetChildContainer ( void  )
static

Definition at line 267 of file container.c.

268{
269 HRESULT hr;
270 WCHAR container[256] = {0};
271 IDxDiagContainer *child;
272
274 {
275 skip("Unable to create the root IDxDiagContainer\n");
276 return;
277 }
278
279 /* Test various combinations of invalid parameters. */
281 ok(hr == E_INVALIDARG,
282 "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
283
284 child = (void*)0xdeadbeef;
286 ok(hr == E_INVALIDARG,
287 "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
288 ok(child == (void*)0xdeadbeef, "Expected output pointer to be unchanged, got %p\n", child);
289
291 ok(hr == E_INVALIDARG,
292 "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
293
294 child = (void*)0xdeadbeef;
296 ok(hr == E_INVALIDARG,
297 "Expected IDxDiagContainer::GetChildContainer to return E_INVALIDARG, got 0x%08x\n", hr);
298 ok(child == NULL, "Expected output pointer to be NULL, got %p\n", child);
299
300 /* Get the name of a suitable child container. */
302 ok(hr == S_OK,
303 "Expected IDxDiagContainer::EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
304 if (FAILED(hr))
305 {
306 skip("IDxDiagContainer::EnumChildContainerNames failed\n");
307 goto cleanup;
308 }
309
310 child = (void*)0xdeadbeef;
312 ok(hr == S_OK,
313 "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
314 ok(child != NULL && child != (void*)0xdeadbeef, "Expected a valid output pointer, got %p\n", child);
315
316 if (SUCCEEDED(hr))
317 {
318 IDxDiagContainer *ptr;
319
320 /* Show that IDxDiagContainer::GetChildContainer returns a different pointer
321 * for multiple calls for the same container name. */
323 ok(hr == S_OK,
324 "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
325 if (SUCCEEDED(hr))
326 ok(ptr != child, "Expected the two pointers (%p vs. %p) to be unequal\n", child, ptr);
327
330 }
331
332cleanup:
335}
static PVOID ptr
Definition: dispmode.c:27

Referenced by START_TEST().

◆ test_GetNumberOfChildContainers()

static void test_GetNumberOfChildContainers ( void  )
static

Definition at line 99 of file container.c.

100{
101 HRESULT hr;
102 DWORD count;
103
105 {
106 skip("Unable to create the root IDxDiagContainer\n");
107 return;
108 }
109
111 ok(hr == E_INVALIDARG,
112 "Expected IDxDiagContainer::GetNumberOfChildContainers to return E_INVALIDARG, got 0x%08x\n", hr);
113
115 ok(hr == S_OK,
116 "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
117 if (hr == S_OK)
118 ok(count != 0, "Expected the number of child containers for the root container to be non-zero\n");
119
122}

Referenced by START_TEST().

◆ test_GetNumberOfProps()

static void test_GetNumberOfProps ( void  )
static

Definition at line 124 of file container.c.

125{
126 HRESULT hr;
127 DWORD count;
128
130 {
131 skip("Unable to create the root IDxDiagContainer\n");
132 return;
133 }
134
136 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetNumberOfProps to return E_INVALIDARG, got 0x%08x\n", hr);
137
139 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfProps to return S_OK, got 0x%08x\n", hr);
140 if (hr == S_OK)
141 ok(count == 0, "Expected the number of properties for the root container to be zero\n");
142
145}

Referenced by START_TEST().

◆ test_GetProp()

static void test_GetProp ( void  )
static

Definition at line 574 of file container.c.

575{
576 HRESULT hr;
577 WCHAR container[256], property[256];
578 IDxDiagContainer *child = NULL;
580 VARIANT var;
581 SAFEARRAY *sa;
582 SAFEARRAYBOUND bound;
583 ULONG ref;
584 static const WCHAR emptyW[] = {0};
585 static const WCHAR testW[] = {'t','e','s','t',0};
586
588 {
589 skip("Unable to create the root IDxDiagContainer\n");
590 return;
591 }
592
593 /* Find a container with a property. */
595 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
596 if (FAILED(hr))
597 {
598 skip("IDxDiagContainer::GetNumberOfChildContainers failed\n");
599 goto cleanup;
600 }
601
602 for (index = 0; index < count; index++)
603 {
605 ok(hr == S_OK, "Expected IDxDiagContainer_EnumChildContainerNames to return S_OK, got 0x%08x\n", hr);
606 if (FAILED(hr))
607 {
608 skip("IDxDiagContainer::EnumChildContainerNames failed\n");
609 goto cleanup;
610 }
611
613 ok(hr == S_OK, "Expected IDxDiagContainer::GetChildContainer to return S_OK, got 0x%08x\n", hr);
614
615 if (SUCCEEDED(hr))
616 {
618 ok(hr == S_OK || hr == E_INVALIDARG,
619 "Expected IDxDiagContainer::EnumPropNames to return S_OK or E_INVALIDARG, got 0x%08x\n", hr);
620
621 if (SUCCEEDED(hr))
622 break;
623 else
624 {
626 child = NULL;
627 }
628 }
629 }
630
631 if (!child)
632 {
633 skip("Unable to find a suitable container\n");
634 goto cleanup;
635 }
636
638 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr);
639
640 V_VT(&var) = 0xdead;
642 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr);
643 ok(V_VT(&var) == 0xdead, "Expected the variant to be untouched, got %u\n", V_VT(&var));
644
646 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr);
647
648 V_VT(&var) = 0xdead;
650 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr);
651 ok(V_VT(&var) == 0xdead, "Expected the variant to be untouched, got %u\n", V_VT(&var));
652
654 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr);
655
656 V_VT(&var) = 0xdead;
658 ok(hr == E_INVALIDARG, "Expected IDxDiagContainer::GetProp to return E_INVALIDARG, got 0x%08x\n", hr);
659 ok(V_VT(&var) == 0xdead, "Expected the variant to be untouched, got %u\n", V_VT(&var));
660
663 ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr);
664 ok(V_VT(&var) != VT_EMPTY, "Expected the variant to be modified, got %d\n", V_VT(&var));
665
666 /* Since the documentation for IDxDiagContainer::GetProp claims that the
667 * function reports return values from VariantCopy, try to exercise failure
668 * paths in handling the destination variant. */
669
670 /* Try an invalid variant type. */
671 V_VT(&var) = 0xdead;
673 ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr);
674 ok(V_VT(&var) != 0xdead, "Expected the variant to be modified, got %d\n", V_VT(&var));
675
676 /* Try passing a variant with a locked SAFEARRAY. */
677 bound.cElements = 1;
678 bound.lLbound = 0;
679 sa = SafeArrayCreate(VT_UI1, 1, &bound);
680 ok(sa != NULL, "Expected SafeArrayCreate to return a valid pointer\n");
681
682 V_VT(&var) = (VT_ARRAY | VT_UI1);
683 V_ARRAY(&var) = sa;
684
686 ok(hr == S_OK, "Expected SafeArrayLock to return S_OK, got 0x%08x\n", hr);
687
689 ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr);
690 ok(V_VT(&var) != (VT_ARRAY | VT_UI1), "Expected the variant to be modified\n");
691
693 ok(hr == S_OK, "Expected SafeArrayUnlock to return S_OK, got 0x%08x\n", hr);
695 ok(hr == S_OK, "Expected SafeArrayDestroy to return S_OK, got 0x%08x\n", hr);
696
697 /* Determine whether GetProp calls VariantClear on the passed variant. */
698 V_VT(&var) = VT_UNKNOWN;
701
703 ok(hr == S_OK, "Expected IDxDiagContainer::GetProp to return S_OK, got 0x%08x\n", hr);
704 ok(V_VT(&var) != VT_UNKNOWN, "Expected the variant to be modified\n");
705
708 ok(ref == 2, "Expected reference count to be 2, got %u\n", ref);
710
712cleanup:
715}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_ARRAY
Definition: compat.h:2341
@ VT_UI1
Definition: compat.h:2311
HRESULT WINAPI SafeArrayUnlock(SAFEARRAY *psa)
Definition: safearray.c:831
HRESULT WINAPI SafeArrayLock(SAFEARRAY *psa)
Definition: safearray.c:795
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:600
#define IDxDiagContainer_AddRef(p)
Definition: dxdiag.h:65
static const WCHAR emptyW[]
Definition: navigate.c:40
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_UNKNOWN(A)
Definition: oleauto.h:281
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by START_TEST().

◆ test_root_children()

static void test_root_children ( void  )
static

Definition at line 717 of file container.c.

718{
719 static const WCHAR DxDiag_DirectSound[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d',0};
720 static const WCHAR DxDiag_DirectMusic[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','M','u','s','i','c',0};
721 static const WCHAR DxDiag_DirectInput[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','I','n','p','u','t',0};
722 static const WCHAR DxDiag_DirectPlay[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','P','l','a','y',0};
723 static const WCHAR DxDiag_SystemDevices[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','D','e','v','i','c','e','s',0};
724 static const WCHAR DxDiag_DirectXFiles[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','X','F','i','l','e','s',0};
725 static const WCHAR DxDiag_DirectShowFilters[] = {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','h','o','w','F','i','l','t','e','r','s',0};
726 static const WCHAR DxDiag_LogicalDisks[] = {'D','x','D','i','a','g','_','L','o','g','i','c','a','l','D','i','s','k','s',0};
727
728 HRESULT hr;
730
731 static const WCHAR *root_children[] = {
732 DxDiag_SystemInfo, DxDiag_DisplayDevices, DxDiag_DirectSound,
733 DxDiag_DirectMusic, DxDiag_DirectInput, DxDiag_DirectPlay,
734 DxDiag_SystemDevices, DxDiag_DirectXFiles, DxDiag_DirectShowFilters,
735 DxDiag_LogicalDisks
736 };
737
739 {
740 skip("Unable to create the root IDxDiagContainer\n");
741 return;
742 }
743
744 /* Verify the identity and ordering of the root container's children. */
746 ok(hr == S_OK, "Expected IDxDiagContainer::GetNumberOfChildContainers to return S_OK, got 0x%08x\n", hr);
747 if (FAILED(hr))
748 {
749 skip("IDxDiagContainer::GetNumberOfChildContainers failed\n");
750 goto cleanup;
751 }
752
753 ok(count == ARRAY_SIZE(root_children),
754 "Got unexpected count %u for the number of child containers\n", count);
755
756 if (count != ARRAY_SIZE(root_children))
757 {
758 skip("Received unexpected number of child containers\n");
759 goto cleanup;
760 }
761
762 for (index = 0; index <= count; index++)
763 {
764 WCHAR container[256];
765
767 if (hr == E_INVALIDARG)
768 {
769 ok(index == count,
770 "Expected IDxDiagContainer::EnumChildContainerNames to return "
771 "E_INVALIDARG on the last index %u\n", count);
772 break;
773 }
774 else if (hr == S_OK)
775 {
776 ok(!lstrcmpW(container, root_children[index]),
777 "Expected container %s for index %u, got %s\n",
778 wine_dbgstr_w(root_children[index]), index, wine_dbgstr_w(container));
779 }
780 else
781 {
782 ok(0, "IDxDiagContainer::EnumChildContainerNames unexpectedly returned 0x%08x\n", hr);
783 break;
784 }
785 }
786
787cleanup:
790}
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170

Referenced by START_TEST().

Variable Documentation

◆ DxDiag_DisplayDevices

const WCHAR DxDiag_DisplayDevices[] = {'D','x','D','i','a','g','_','D','i','s','p','l','a','y','D','e','v','i','c','e','s',0}
static

◆ DxDiag_SoundCaptureDevices

const WCHAR DxDiag_SoundCaptureDevices[]
static
Initial value:
= {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d','.',
'D','x','D','i','a','g','_','S','o','u','n','d','C','a','p','t','u','r','e',
'D','e','v','i','c','e','s',0}

Definition at line 41 of file container.c.

Referenced by build_directsound_tree(), and test_DxDiag_SoundCaptureDevices().

◆ DxDiag_SoundDevices

const WCHAR DxDiag_SoundDevices[]
static
Initial value:
= {'D','x','D','i','a','g','_','D','i','r','e','c','t','S','o','u','n','d','.',
'D','x','D','i','a','g','_','S','o','u','n','d','D','e','v','i','c','e','s',0}

Definition at line 39 of file container.c.

Referenced by build_directsound_tree(), and test_DxDiag_SoundDevices().

◆ DxDiag_SystemInfo

const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0}
static

Definition at line 37 of file container.c.

Referenced by build_information_tree(), test_DxDiag_SystemInfo(), and test_root_children().

◆ pddc

◆ pddp