Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] 103 Errors from ctype.h?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Jun 29, 2008 12:44 pm    Post subject: [C++] 103 Errors from ctype.h? Reply with quote

When I include "windef.h" by itself (no Windows.h), I get 103 errors.

Examples:

Code:

Error   1   error C2144: syntax error : 'int' should be preceded by ';'   c:\program files\microsoft visual studio 9.0\vc\include\ctype.h   94   InstallMonitor



on the line

Code:

_Check_return_ _CRTIMP int __cdecl _isctype(_In_ int _C, _In_ int _Type);


Using Visual Studio, I can see that both "_Check_resturn_" and "_CRTIMP" are defined and what not.

What's wrong?

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon Jun 30, 2008 6:55 am    Post subject: Reply with quote

Posting an example source would help with solving the problem?
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jun 30, 2008 5:26 pm    Post subject: Reply with quote

That was an example.

I could have put simply the include, and it would have flipped out like that (I tested).

I still haven't figured out what's wrong, but I switched the way I was doing it, so whatever.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
gmusaka
Expert Cheater
Reputation: 0

Joined: 30 Jan 2008
Posts: 191

PostPosted: Mon Jun 30, 2008 5:47 pm    Post subject: Reply with quote

OMG SAM CHECK YOur Pmz. ITS CIPHAS [Way-offtopic]
Sorry for posting but he is a friend from along time ago?!

_________________
1 #473 |\/|4ρŁ3ƒ495
I do HTML for them all
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Jun 30, 2008 7:26 pm    Post subject: Reply with quote

Just include windows.h, including separate headers, like you did, will lead to errors as you will be missing macros, defines, etc. from other headers that should be included before the one you are attempting to use.

If you don't want to use windows.h, look at the headers that are included before windef.h and include the ones you need. You will just lead to more hassle doing it that way though.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Tue Jul 01, 2008 11:01 am    Post subject: Reply with quote

samuri25404 wrote:
That was an example.

I could have put simply the include, and it would have flipped out like that (I tested).
Tried -> an error about umm.. Something else not being defined -> I automatically added windows.h to includes -> No error -> Me is confused about your problem :) Thought you could have given a tiny piece of code with all the includes etc.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Tue Jul 01, 2008 4:28 pm    Post subject: Reply with quote

Wiccaan wrote:
Just include windows.h, including separate headers, like you did, will lead to errors as you will be missing macros, defines, etc. from other headers that should be included before the one you are attempting to use.

If you don't want to use windows.h, look at the headers that are included before windef.h and include the ones you need. You will just lead to more hassle doing it that way though.


Including windows.h doesn't allow it to build when using DDK, because there are a bunch of redefinitions in there. I don't understand, though, when I hover over the "not defined" items, they're defined, because VS shows me what they are.

Also, in DB's driver (was using it for an example), he includes ntifs.h, and windef.h, and obviously it builds fine.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Jul 01, 2008 5:12 pm    Post subject: Reply with quote

What are you making? There are different include files used for different types of drivers.

For example:
A device driver would use ntddk.h.
A file system driver would use ntifs.h.

Also what are your errors without windef.h? I assume that most of your errors are due to using macros that C does not use or invalid code structure meaning you are not putting variables at the top of functions and such like C requires.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Tue Jul 01, 2008 5:54 pm    Post subject: Reply with quote

Wiccaan wrote:
What are you making? There are different include files used for different types of drivers.

For example:
A device driver would use ntddk.h.
A file system driver would use ntifs.h.

Also what are your errors without windef.h? I assume that most of your errors are due to using macros that C does not use or invalid code structure meaning you are not putting variables at the top of functions and such like C requires.


Same prog I was telling you about before, I just wanted to hook the lower leveled functions, e.g. Nt/ZwCreateFile.

o_O Dark Byte referenced his driver as a device driver, but used ntifs.h. Also, I don't think you can call file system drivers with DeviceIoControl, right? I might be mistaken.

I've long since changed my code around, so I can't give you anything exact, though they were stupid little things like "DWORD" not defined, and stuff like that.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Jul 01, 2008 6:05 pm    Post subject: Reply with quote

Yeah, C doesn't use 'DWORD' instead things are just written out like they should be, like 'unsigned long' for DWORD. You can just create the typedefs yourself if you want things like that, but those are not C specific.

DeviceIoControl:
http://msdn.microsoft.com/en-us/library/aa363216(VS.85).aspx

Pretty sure you can use it on any. As the MSDN documents, there are several codes you can use which include:

* Communications Control Codes
* Device Management Control Codes
* Directory Management Control Codes
* Disk Management Control Codes
* File Management Control Codes
* Power Management Control Codes
* Volume Management Control Codes

I'm not certain either, but the way that reads, it seems you can.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites