Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deviare DB cannot be rebuilt #28

Open
bo3b opened this issue Aug 16, 2017 · 4 comments
Open

Deviare DB cannot be rebuilt #28

bo3b opened this issue Aug 16, 2017 · 4 comments

Comments

@bo3b
Copy link

bo3b commented Aug 16, 2017

Always possible I'm doing something wrong, but I'm getting fatal errors when trying to rebuild the DB.

I wanted access to the d3d9.dll!SetRenderState function. As near as I can tell, that function is missing from the DB that ships with 2.8.3. If I use the DbFunctions call, I do not find that function in the returned list.

        NktDbObjectsEnum funcs = spyMgr.DbFunctions(theball.PlatformBits);
        for (int i = 0; i < funcs.Count; i++)
        {
            NktDbObject funcObj = funcs.GetAt(i);
            Console.WriteLine(i + ": " + funcObj.Name);
         ...

Trying to limit the function list to just the d3d9.dll module, I get an AccessViolation exception when I try to fetch the functions for that module. Not sure if this is related, but it seemed odd.

        INktDbModulesEnum modules = spyMgr.DbModules(theball.PlatformBits);
        NktDbModule d3d9 = modules.GetByName("d3d9.dll");   <<< works
        NktDbObjectsEnum functions = d3d9.DbFunctions();     <<< crash
        for (int i = 0; i < functions.Count; i++)
        {
            NktDbObject funcObj = functions.GetAt(i);
            Console.WriteLine(i + ": " + funcObj.Name + "  " + funcObj.Declaration);
        }

Searching the entire function list for a partial name match of "SetRender" did not show any results, which makes me think it is missing.


Then took a look at rebuilding the DB with current header files. As near as I can tell, this is not currently possible.

The documentation suggests using a zip file that is not available, but seems to be clearly related to the other tools in the Database folder. Running the build32.bat full and build64.bat full generated the expected preprocessed*.h files.

However, running the DbBuilder/build_32.bat against those files gives 60 or so errors.

c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:148788: error: wrong number of arguments specified for 'deprecated' attribute

This error appears to happen because the gcc compiler used for building the DB is old, and does not support parameters for the 'deprecated' attribute. For example:

typedef struct __declspec(deprecated("Use ""ADDRINFOEX2W"" instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings")) addrinfoex2A

It's not the double quotes, it's the entire string parameter it does not like.


There are a handful of other errors as well.

Not sure this is helpful, but thought I'd report it as not working with Visual Studio 2013, and SDK 8.1 headers. As noted, I cannot be certain I setup or built this all correctly.

@Helios-vmg
Copy link

As a quick fix, would it work to #define deprecated(x) deprecated? That declspec has no bearing on the calling convention or name mangling anyway.

@bo3b
Copy link
Author

bo3b commented Aug 17, 2017

As a quick fix, would it work to #define deprecated(x) deprecated? That declspec has no bearing on the calling convention or name mangling anyway.

I'll give that a try and report back.

BTW, VS2017 also can not rebuild the DB. The problems are different, and include a number of broken header files in the SDK 10.0. Probably worth waiting on that until 2017 is more complete.

@bo3b
Copy link
Author

bo3b commented Aug 17, 2017

As a quick fix, would it work to #define deprecated(x) deprecated? That declspec has no bearing on the calling convention or name mangling anyway.

Adding that #define to the start of the preprocessed32W.h file does work to remove all of the deprecated errors.

This is using \Windows Kits\8.1 for the header files, instead of the \Windows Kits\10.0


There are still a handful of errors as:

Loading configuration file... OK
----------------------------------------
Compiling header file (c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h)...
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:22959: error: expected initializer before 'void'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:218955: error: two or more data types in declaration of 'strtold'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:218956: error: two or more data types in declaration of '_strtold_l'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:219107: error: two or more data types in declaration of 'wcstold'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:219108: error: two or more data types in declaration of '_wcstold_l'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:2009356: error: declaration of C function 'HRESULT GetDeviceID(UINT8*, UINT32, unsigned int*, INT32*)' conflicts with
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:458334: error: previous declaration 'HRESULT GetDeviceID(const GUID*, GUID*)' here
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:2062672: error: declaration of 'TextEditChangeType UiaTextEditTextChangedEventArgs::TextEditChangeType'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:2043235: error: changes meaning of 'TextEditChangeType' from 'enum TextEditChangeType'
Error: Compilation failed

Mostly I'm not worried about missing a few of those calls in the DB, so commenting them out is an OK temporary solution.

@bo3b
Copy link
Author

bo3b commented Aug 17, 2017

With a bit of manual trickery, setting the Include path for cl, I forced it to use the \Windows Kits\8.0

This is older of course, and not necessarily what people would want. We have to use the 8.0 headers for our 3Dmigoto tool.

Running the build32.bat full, and build64.bat full, and then build_db32.bat, that still fails with a handful of the same errors:

Loading configuration file... OK
----------------------------------------
Compiling header file (c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h)...
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:215809: error: two or more data types in declaration of 'strtold'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:215810: error: two or more data types in declaration of '_strtold_l'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:215961: error: two or more data types in declaration of 'wcstold'
c:\Users\bo3b\Documents\Code\Deviare2\Database\HeaderBuilder\Full\output\preprocessed32W.h:215962: error: two or more data types in declaration of '_wcstold_l'
Error: Compilation failed

These are actually easy enough to fix, the processing created a function like:

 int double __cdecl strtold(  const char * _Str,     char ** _EndPtr);

Which doesn't make sense of course. If I change that in the preprocessed32W.h file to long double then it works.

Don't know if this is helpful, but thought the extra details might help someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants