| View previous topic :: View next topic |
| Author |
Message |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sun Jun 29, 2008 12:44 pm Post subject: [C++] 103 Errors from ctype.h? |
|
|
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?
_________________
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Mon Jun 30, 2008 6:55 am Post subject: |
|
|
| Posting an example source would help with solving the problem?
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Mon Jun 30, 2008 5:26 pm Post subject: |
|
|
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.
_________________
|
|
| Back to top |
|
 |
gmusaka Expert Cheater
Reputation: 0
Joined: 30 Jan 2008 Posts: 191
|
Posted: Mon Jun 30, 2008 5:47 pm Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Jun 30, 2008 7:26 pm Post subject: |
|
|
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 |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Tue Jul 01, 2008 11:01 am Post subject: |
|
|
| 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 |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Tue Jul 01, 2008 4:28 pm Post subject: |
|
|
| 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.
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jul 01, 2008 5:12 pm Post subject: |
|
|
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 |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Tue Jul 01, 2008 5:54 pm Post subject: |
|
|
| 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.
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jul 01, 2008 6:05 pm Post subject: |
|
|
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 |
|
 |
|