Using PowerShell Scripting to send IOCTLs down to my kernel mode driver

Hi All,

Apologies if this is a duplicate of another thread already discussed.

I am new to PowerShell and wondering if it is possible to write scripts which would run in user mode and send IOCTLs down to my kernel mode driver in Windows OS to retrieve information from the driver? Of course my driver has the capability to identify and handle the IOCTL.

It is basically a step 1 to integrating PowerShell support for my driver.

Any input/suggestion would be helpful.

Thanks in advance!

Hello!

Of cause. PS is just a generic shell, which allows Commands (called “Cmdlets”) to be implemented. You need to use a managed language (like c#), and P-Invoke to the necessary APIs (CreateFile, DeviceIOControl, CloseHandle, …).

[Tutorials for Writing Cmdlets]
http://msdn.microsoft.com/en-us/library/dd878321(VS.85).aspx

BTW: A generic Cmdlets to send any IOCTL to any device would need to operate on the buffer-level, so the user of the Cmdlet would need to build the input-buffer, and interpret the output-buffer on its own, which may be a good test if your parameter-validation code is correct, but will not be of great use!

GP

schrieb im Newsbeitrag news:…
> Hi All,
>
> Apologies if this is a duplicate of another thread already discussed.
>
> I am new to PowerShell and wondering if it is possible to write scripts which would run in user mode and send IOCTLs down to my kernel mode driver in Windows OS to retrieve information from the driver? Of course my driver has the capability to identify and handle the IOCTL.
>
> It is basically a step 1 to integrating PowerShell support for my driver.
>
> Any input/suggestion would be helpful.
>
> Thanks in advance!
>

________________________________

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the ricipient. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

xxxxx@intel.com wrote:

I am new to PowerShell and wondering if it is possible to write scripts which would run in user mode and send IOCTLs down to my kernel mode driver in Windows OS to retrieve information from the driver? Of course my driver has the capability to identify and handle the IOCTL.

It is basically a step 1 to integrating PowerShell support for my driver.

Any input/suggestion would be helpful.

PowerShell can run arbitrary commands, like any shell, but PowerShell
also has good built-in support for WMI. We tend to pass over WMI in the
driver world, because it requires a fair amount of coding overhead, and
ioctls are easier, but WMI is a great way to allow your driver to be
manipulated by standard tools.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Great. Thanks Tim and Gunter.

I will look up the blog and hopefully now have a point to get started. :slight_smile: