Thanks, I tried, but this error occurred during compilation:
errors in directory d:\drivers
d:\drivers\hello
W@12 referenced in function _DriverEntry@8
d:\drivers\o
Main Topics
Browse All TopicsWe'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!!!)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: JbamaralPosted on 2009-01-26 at 06:42:02ID: 23466893
You could just declare the CopyFile functiion directly instead of including windows.h to avoid the compiler errors, but I dont know if you'll have access to CopyFile from a device driver or if it will link.
om/kb/8918 05/
You can check the KB891805 on how to acess files from a kernel mode dd.
http://support.microsoft.c
For the CopyFile function to compile either declare
__declspec(dllimport)
int
__stdcall
CopyFileA(
const char * lpExistingFileName,
const char * lpNewFileName,
int bFailIfExists
);
or
__declspec(dllimport)
int
__stdcall
CopyFileW(
const char * lpExistingFileName,
const char * lpNewFileName,
int bFailIfExists
);
depending on your compiler settings (if using unicode ( CopyFileA ) or ansi chars (CopyFileW) )