[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Kernel Mode Drivers and Windows API's

Asked by Mortaza_doulaty in C Programming Language, Drivers, Kernel And Operating System Specific Programming

Tags: Kernel Mode Driver, C, C++, API

We've already a complete and working kernel mode driver, written in C and compiled using Windows Driver Kit 6000 (Windows XP Checked Environment)
No I want to modify it so that when it starts (DriverEntry function), it copies it's log file (located in windows directory) to another folder, and creates a new log file.

For copying, I try to #include <windows.h>
Then use CopyFile function. But when compiling, The following errors occur. (102 Errors!!!)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
errors in directory d:\drivers
c:\winddk\6000\inc\api\winbase.h(314) : error C2061: syntax error : identifier '
CRITICAL_SECTION'
c:\winddk\6000\inc\api\winbase.h(314) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(315) : error C2061: syntax error : identifier '
PCRITICAL_SECTION'
c:\winddk\6000\inc\api\winbase.h(315) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(316) : error C2061: syntax error : identifier '
LPCRITICAL_SECTION'
c:\winddk\6000\inc\api\winbase.h(316) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(318) : error C2061: syntax error : identifier '
CRITICAL_SECTION_DEBUG'
c:\winddk\6000\inc\api\winbase.h(318) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(319) : error C2061: syntax error : identifier '
PCRITICAL_SECTION_DEBUG'
c:\winddk\6000\inc\api\winbase.h(319) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(320) : error C2061: syntax error : identifier '
LPCRITICAL_SECTION_DEBUG'
c:\winddk\6000\inc\api\winbase.h(320) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(399) : error C2061: syntax error : identifier '
SRWLOCK'
c:\winddk\6000\inc\api\winbase.h(399) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(399) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(407) : error C2146: syntax error : missing ')'
before identifier 'SRWLock'
c:\winddk\6000\inc\api\winbase.h(407) : error C2061: syntax error : identifier '
SRWLock'
c:\winddk\6000\inc\api\winbase.h(407) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(408) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(414) : error C2146: syntax error : missing ')'
before identifier 'SRWLock'
c:\winddk\6000\inc\api\winbase.h(414) : error C2061: syntax error : identifier '
SRWLock'
c:\winddk\6000\inc\api\winbase.h(414) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(415) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(421) : error C2146: syntax error : missing ')'
before identifier 'SRWLock'
c:\winddk\6000\inc\api\winbase.h(421) : error C2061: syntax error : identifier '
SRWLock'
c:\winddk\6000\inc\api\winbase.h(421) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(422) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(428) : error C2146: syntax error : missing ')'
before identifier 'SRWLock'
c:\winddk\6000\inc\api\winbase.h(428) : error C2061: syntax error : identifier '
SRWLock'
c:\winddk\6000\inc\api\winbase.h(428) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(429) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(435) : error C2146: syntax error : missing ')'
before identifier 'SRWLock'
c:\winddk\6000\inc\api\winbase.h(435) : error C2061: syntax error : identifier '
SRWLock'
c:\winddk\6000\inc\api\winbase.h(435) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(436) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(442) : error C2061: syntax error : identifier '
CONDITION_VARIABLE'
c:\winddk\6000\inc\api\winbase.h(442) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(442) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(448) : error C2146: syntax error : missing ')'
before identifier 'ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(448) : error C2061: syntax error : identifier '
ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(448) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(449) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(455) : error C2146: syntax error : missing ')'
before identifier 'ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(455) : error C2061: syntax error : identifier '
ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(455) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(456) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(462) : error C2146: syntax error : missing ')'
before identifier 'ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(462) : error C2061: syntax error : identifier '
ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(462) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(463) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(469) : error C2146: syntax error : missing ')'
before identifier 'ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(469) : error C2061: syntax error : identifier '
ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(469) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(469) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(472) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(478) : error C2146: syntax error : missing ')'
before identifier 'ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(478) : error C2061: syntax error : identifier '
ConditionVariable'
c:\winddk\6000\inc\api\winbase.h(478) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(478) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(482) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(529) : error C2061: syntax error : identifier '
LPLDT_ENTRY'
c:\winddk\6000\inc\api\winbase.h(529) : error C2059: syntax error : ';'
warnings in directory d:\drivers
c:\winddk\6000\inc\api\winbase.h(2278) : warning C4005: 'InterlockedExchangePoin
ter' : macro redefinition
c:\winddk\6000\inc\api\winbase.h(2291) : error C2059: syntax error : '('
c:\winddk\6000\inc\api\winbase.h(2468) : warning C4005: 'InterlockedCompareExcha
ngePointer' : macro redefinition
c:\winddk\6000\inc\api\winbase.h(2494) : error C2375: 'InitializeSListHead' : re
definition; different linkage
c:\winddk\6000\inc\api\winbase.h(2501) : error C2373: 'InterlockedPopEntrySList'
 : redefinition; different type modifiers
c:\winddk\6000\inc\api\winbase.h(2509) : error C2373: 'InterlockedPushEntrySList
' : redefinition; different type modifiers
c:\winddk\6000\inc\api\winbase.h(2516) : error C2373: 'ExInterlockedFlushSList'
: redefinition; different type modifiers
c:\winddk\6000\inc\api\winbase.h(2523) : error C2059: syntax error : '('
c:\winddk\6000\inc\api\winbase.h(2902) : error C2146: syntax error : missing ')'
 before identifier 'lpBuffer'
c:\winddk\6000\inc\api\winbase.h(2902) : error C2081: 'PMEMORY_BASIC_INFORMATION
' : name in formal parameter list illegal
c:\winddk\6000\inc\api\winbase.h(2902) : error C2061: syntax error : identifier
'lpBuffer'
c:\winddk\6000\inc\api\winbase.h(2902) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(2902) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(2904) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(3008) : error C2146: syntax error : missing ')'
 before identifier 'lpBuffer'
c:\winddk\6000\inc\api\winbase.h(3008) : error C2081: 'PMEMORY_BASIC_INFORMATION
' : name in formal parameter list illegal
c:\winddk\6000\inc\api\winbase.h(3008) : error C2061: syntax error : identifier
'lpBuffer'
c:\winddk\6000\inc\api\winbase.h(3008) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(3008) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(3010) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(3153) : error C2146: syntax error : missing ')'
 before identifier 'HeapInformationClass'
c:\winddk\6000\inc\api\winbase.h(3153) : error C2081: 'HEAP_INFORMATION_CLASS' :
 name in formal parameter list illegal
c:\winddk\6000\inc\api\winbase.h(3153) : error C2061: syntax error : identifier
'HeapInformationClass'
c:\winddk\6000\inc\api\winbase.h(3153) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(3153) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(3156) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(3163) : error C2146: syntax error : missing ')'
 before identifier 'HeapInformationClass'
c:\winddk\6000\inc\api\winbase.h(3163) : error C2081: 'HEAP_INFORMATION_CLASS' :
 name in formal parameter list illegal
c:\winddk\6000\inc\api\winbase.h(3163) : error C2061: syntax error : identifier
'HeapInformationClass'
c:\winddk\6000\inc\api\winbase.h(3163) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(3163) : error C2059: syntax error : ','
c:\winddk\6000\inc\api\winbase.h(3167) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(3823) : error C2146: syntax error : missing ')'
 before identifier 'lpSelectorEntry'
c:\winddk\6000\inc\api\winbase.h(3823) : error C2081: 'LPLDT_ENTRY' : name in fo
rmal parameter list illegal
c:\winddk\6000\inc\api\winbase.h(3823) : error C2061: syntax error : identifier
'lpSelectorEntry'
c:\winddk\6000\inc\api\winbase.h(3823) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(3824) : error C2059: syntax error : ')'
c:\winddk\6000\inc\api\winbase.h(4031) : error C2146: syntax error : missing ')'
 before identifier 'lpContext'
c:\winddk\6000\inc\api\winbase.h(4031) : error C2081: 'PWOW64_CONTEXT' : name in
 formal parameter list illegal
c:\winddk\6000\inc\api\winbase.h(4031) : error C2061: syntax error : identifier
'lpContext'
c:\winddk\6000\inc\api\winbase.h(4031) : error C2059: syntax error : ';'
c:\winddk\6000\inc\api\winbase.h(4031) : error C1003: error count exceeds 100; s
topping compilation
[+][-]01/26/09 06:42 AM, ID: 23466893Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: C Programming Language, Drivers, Kernel And Operating System Specific Programming
Tags: Kernel Mode Driver, C, C++, API
Sign Up Now!
Solution Provided By: Jbamaral
Participating Experts: 1
Solution Grade: A
 
[+][-]01/26/09 10:41 PM, ID: 23474140Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/27/09 05:43 AM, ID: 23476130Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625