Home > Software engineering >  Use vc2013 WDK how to implement the following of the driver? Glad to thank you!
Use vc2013 WDK how to implement the following of the driver? Glad to thank you!

Time:11-02

Use vc2013 + WDK with how to implement the following driver? Glad to thank you!
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Driver compatibility:
Windows 7/doing/Win8.1/Win10 32 bit or 64 bit support all
Main functions:
Global hooks exe name in the list of all processes, and get all the parameters, and determine the content of parameter specifies the content to replace,
For example:
1) the user starts netbardaemon. Exe, gain parameter list is empty, so after the hooks. Change the parameter to netbardaemon exe - with - feature=feature1, feature2
Users through the shortcut start netbardaemon. Exe, the shortcut attached parameters - disable - heartbeat=true - disable - feature, change the parameters after the hooks for netbardaemon. Exe - disable - heartbeat=true - with - feature=feature1, feature2

CodePudding user response:

Charge it!
Fyi:
Using a debugger (OD, WINDBG) debugging service program
To debug the initialization code of a service application, the debugger must be attached when the service is started. This is accomplished by creating a registry key:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Image File Execution Options \ ProgramName


The ProgramName is The image file for The service application you are was debugging. Do not specify a path. For example, The ProgramName took look like MyService. Exe.

Under this key The create a string data value called The Debugger. The value of this string should be set to The full path of The Debugger that will be 2. For example,

C: \ Debuggers \ windbg exe



In addition to setting this registry key, the service application must be marked as "interactive". This allows your service to interact with the desktop, and allows the debugger window to appear on your desktop.

This again requires modifying a registry key, you must bitwise - or the type entry for service with 0 x100 (This is the value for SERVICE_INTERACTIVE_PROCESS "according to Winnt. H). The exact location and the name of This registry entry around the for example:

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ MyServiceKey


Finally, you need to adjust the service application timeout. Otherwise, the service application will kill the debugger within 20 seconds after starting, Adjusting the timeout involves setting an entry in the following registry key:

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control


Under this key, the create a DWORD data value called ServicesPipeTimeout. Set this entry to the amount of time in milliseconds that want the service to wait before timing out. For example, 60000 is one minute, while 86400000 is 24 hours.

Set to come into force after ServicesPipeTimeout need to restart the system

Now, when the service is started, the debugger will also start. When the debugger starts, it will stop at the initial process breakpoint, before the service has begun running. This allows you to set breakpoints or otherwise configure your debugging session to let you monitor the startup of your service. Another option is to place calls to the DebugBreak function in your service from the point at which you would like to break into the debugger. (For more information, see DebugBreak in the Platform SDK documentation.)

If your service is running with other services in a service Host Process, you may need to isolate the service into its own service Host Process.
  • Related