additional dxdiagn functions

Rob Crittenden <[email protected]>
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <[email protected]>
Attached is a patch (under X11 licence) that fills in some holes in the
dxdiagn implementation. I tested this with the sample program DxDiagOutput.exe
that ships with the DX 9.0b SDK and all seems well. The output is simple
considering there is only 1 child container and just 3 properties.

Note:

1. It would probably be more efficient to store the # of elements in a 
container within the container itself rathern counting each time. Then again,
it isn't like these are called over and over again so it isn't a show stopper.

2. No error checking is done in the Enum function calls so out-of-range
errors are possible.

rob

_______________________________________________
winex-devel mailing list
[email protected]
http://lists.transgaming.org/cgi-bin/mailman/listinfo/winex-devel
container.diff (text/plain, 2.9 KB)
Index: container.c
===================================================================
RCS file: /cvsroot/winex/dlls/dxdiagn/container.c,v
retrieving revision 1.4
diff -r1.4 container.c
90a91,129
> HRESULT WINAPI DxDiagContainer_GetNumberOfChildContainers(
>                                                  PDXDIAGCONTAINER iface,
>                                                  DWORD *pdwCount)
> {
>     ICOM_THIS(IDxDiagContainerImpl, iface);
>     Container_SubContainer *childContainer;
>     int i;
> 
>     i = 0;
>     do
>     {
>         childContainer = &This->scContainers[i];
>         i++;
>     } while (childContainer->pwszContainerName);
> 
>     *pdwCount = i - 1;
> 
>     TRACE("(%p)->(%ld)\n", iface, *pdwCount);
> 
>     return S_OK;
> }
> 
> HRESULT WINAPI DxDiagContainer_EnumChildContainerNames(PDXDIAGCONTAINER iface,
>                                                        DWORD dwIndex,
>                                                        LPWSTR pwszContainer,
>                                                        DWORD cchContainer)
> {
>     ICOM_THIS(IDxDiagContainerImpl, iface);
>     Container_SubContainer *childContainer;
> 
>     childContainer = &This->scContainers[dwIndex];
>    
>     lstrcpynW(pwszContainer, childContainer->pwszContainerName, cchContainer);
> 
>     TRACE("(%p)->(%s)\n", iface, debugstr_w(childContainer->pwszContainerName));
> 
>     return S_OK;
> }
> 
149a189,226
> HRESULT WINAPI DxDiagContainer_GetNumberOfProps(PDXDIAGCONTAINER iface,
>                                                 DWORD *pdwCount)
> {
>     ICOM_THIS(IDxDiagContainerImpl, iface);
>     Container_Property *property;
>     int i;
> 
>     i = 0;
>     do
>     {
>         property = &This->pProperties[i];
>         i++;
>     } while (property->pwszPropName);
> 
>     *pdwCount = i - 1;
> 
>     TRACE("(%p)->(%ld)\n", iface, *pdwCount);
> 
>     return S_OK;
> }
> 
> HRESULT WINAPI DxDiagContainer_EnumPropNames(PDXDIAGCONTAINER iface,
>                                              DWORD dwIndex,
>                                              LPWSTR pwszPropName,
>                                              DWORD cchPropName)
> {
>     ICOM_THIS(IDxDiagContainerImpl, iface);
>     Container_Property *property;
> 
>     property = &This->pProperties[dwIndex];
>    
>     lstrcpynW(pwszPropName, property->pwszPropName, cchPropName);
> 
>     TRACE("(%p)->(%s)\n", iface, debugstr_w(property->pwszPropName));
> 
>     return S_OK;
> }
> 
156,157c233,234
<     (void*)0xdead0004, /* GetNumberOfChildContainers */
<     (void*)0xdead0005, /* EnumChildContainerNames */
---
>     DxDiagContainer_GetNumberOfChildContainers,
>     DxDiagContainer_EnumChildContainerNames,
159,160c236,237
<     (void*)0xdead0007, /* GetNumberOfProps */
<     (void*)0xdead0008, /* EnumProps */
---
>     DxDiagContainer_GetNumberOfProps,
>     DxDiagContainer_EnumPropNames,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.