Viewing the Drivers

Previous chapters have demonstrated that a knowledge of the files used to perform specific Win32 API tasks is essential if you want to use the functions those files contain in your applications. Working with DirectX is no different. However, DirectX does make it relatively easy for you to determine which files it uses and even the version numbers of those files. Figure 13.3 shows the DirectX Files tab of the DirectX Diagnostic Tool utility. Notice that this tab contains a complete list of the DirectX files.

Unfortunately, all that this dialog shows you is the name of the file. There isn't any way to determine what the file does or the functions that it might contain. To learn more about the file, you need to investigate it. A first stop is to locate the file in the System32 folder and open the Properties dialog box for it. Generally, you'll find some descriptive information on the Version tab.

A second step is to look for the file in the Visual Studio .NET or Platform SDK help file. If you look for the DLL version of the file, you'll normally find support information and other helpful tips. However, if you want to learn how the file will affect your programming, look for the LIB file. For example, the first file in Figure 13.3 is DDraw.DLL. If you enter this name as DDraw.LIB in either of the two help files, you'll see various entries for interfaces, enumerations, functions, and programming tips.

Finally, you can use the Dependency Walker to view the file, just as we have for so many other DLLs in the book. Figure 13.4 shows the DDraw.DLL file. Notice the list of function names and file dependencies. Viewing a DLL in Dependency Walker normally provides clues that you won't find by just looking at the help files or performing a search online. However, you'll want to stick with the functions that are documented for public use, even if it takes a while to locate information about a function that looks interesting. Given that DirectX is a little less open than the Win32 API, you'll want to use this technique to ensure that you're gaining access to the full set of features the DLL has to offer.

igure 13.4: Always use the Dependency Walker to ferret out information about the DirectX DLLs.

Tip The DirectX DLLs also contain functions that are meant for internal use only. For example, a search through the help file didn't yield any information about the AcquireDDThreadLock() function shown in Figure 13.4, yet this function exists. Other DirectX DLLs use this function and you should never call it in your application. Of course, it would help if Microsoft condescended to document this fact. One place to look for this type of information is the Transfer Portal For Software Engineers ( site. The AcquireDDThreadLock() function appears on the page.

Was this article helpful?

0 0

Post a comment