This function collects into an XML file various sorts of information about files that seem related to a given executable. The intended use seems to be that the executable needs a patch, shim or similar support in particular circumstances and the collected descriptions of the related files, or some extract from them, can help those circumstances be recognised later (and elsewhere) by the presence of so-called matching files.


SdbGrabMatchingInfo (
    PCWSTR szExe, 
    DWORD dwFilter, 
    PCWSTR szFile);


The szExe argument addresses a pathname of a file-system object, such as an executable file, and the function is to collect information about the matching files in the same directory and (typically) beneath. The pathname can instead specify just the directory. Depending on other arguments, szExe can be ignored.

The low 16 bits of the dwFilter argument define what type of files count as matching files, what type of information to collect, and may even define where to look (overriding szExe). The high 16 bits of dwFilter are bit flags that can more generally vary the function’s behaviour, e.g., to stop the search’s recursion through subdirectories, and to arrange for the one output file to collect descriptions from multiple calls to the function. The types and flags that are supported for the Matching Information Filter are described separately.

The szFile argument names the output file.

Return Value

The function returns TRUE or FALSE for success or failure, respectively.


The SdbGrabMatchingInfo function is exported by name from APPHELP.DLL in version 5.1 and higher, and before then from SDBAPIU.DLL.

Documentation Status

The SdbGrabMatchingInfo function is not documented.

The names given above for the dwFilter and szFile arguments are plausibly Microsoft’s, being extracted from text that APPHELP can write to a log file. Other names are mere placeholders awaiting the discovery of Microsoft’s.

Use by Microsoft

This is not a function that has many callers. In some sense, SdbGrabMatchingInfo is about as obscure as any function can be except by not being used at all. Yet its output is known to anyone who has ever looked at the files that Windows Error Reporting (WER) would upload to Microsoft to describe a problem. Among those files nowadays is one named appcompat.txt, and it is created by APPHLPDM.DLL or PCWUTL.DLL calling SdbGrabMatchingInfo for descriptions of 25 executables (including DLLs) from the same directory as the faulting application.


This function is implemented as SdbGrabMatchingInfoEx with no callback function.