View previous topic :: View next topic |
Author |
Message |
Moon How do I cheat?
Reputation: 0
Joined: 15 Feb 2011 Posts: 9
|
Posted: Tue Feb 22, 2011 8:54 am Post subject: device driver debuging. |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Tue Feb 22, 2011 11:11 am Post subject: |
|
|
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 |
|
 |
Moon How do I cheat?
Reputation: 0
Joined: 15 Feb 2011 Posts: 9
|
Posted: Tue Feb 22, 2011 7:04 pm Post subject: |
|
|
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.
Description: |
|
Filesize: |
38.1 KB |
Viewed: |
9777 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Tue Feb 22, 2011 7:52 pm Post subject: |
|
|
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 |
|
 |
|