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 


device driver debuging.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
Moon
How do I cheat?
Reputation: 0

Joined: 15 Feb 2011
Posts: 9

PostPosted: Tue Feb 22, 2011 8:54 am    Post subject: device driver debuging. Reply with quote

These days, I'm trying to rewrite dbk32_function.pas in C++ in order to make a DLL. But I met a problem.

When deviceiocontrol function is called for the first time in InitializeDriver function, It fails with error code 31, ERROR_GEN_FAILURE

The description for this error is;
"A device attached to the system is not functioning."

I checked several points. registry and logical file and some handles. But it doesn't seem to have problem.

I have no further idea to find the problem. Is there anything else I can do?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25791
Location: The netherlands

PostPosted: Tue Feb 22, 2011 11:11 am    Post subject: Reply with quote

the device driver service is properly registered and running ?
And you did get a valid handle when opening it ?

And ioctl is build up properly?

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Moon
How do I cheat?
Reputation: 0

Joined: 15 Feb 2011
Posts: 9

PostPosted: Tue Feb 22, 2011 7:04 pm    Post subject: Reply with quote

Thank you DB.

I found that the StartService function fails with an error :
ERROR_SERVICE_ALREADY_RUNNING

But the StartService function wasn't called before.

The code flow is like following:

hSCManager = OpenSCManager(0, 0, GENERIC_READ | GENERIC_WRITE); (success)

hService = OpenService((SC_HANDLE) hSCManager, (LPTSTR) servicename.c_str(), SERVICE_ALL_ACCESS); (success)

ChangeServiceConfig((SC_HANDLE) hService,
SERVICE_KERNEL_DRIVER,
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
(LPTSTR) driverloc.c_str(),
0,
0,
0,
0,
0,
(LPTSTR) servicename.c_str()); (success)

StartService((SC_HANDLE) hService, NULL, NULL) (fail)

And the registry status is like attached image.



registry.png
 Description:
 Filesize:  38.1 KB
 Viewed:  9778 Time(s)

registry.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25791
Location: The netherlands

PostPosted: Tue Feb 22, 2011 7:52 pm    Post subject: Reply with quote

If it is already started then there is no problem, just continue.
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source 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