Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging

The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.

Check out The OSR Learning Library at:

Sending array of ip adresses from json file as ioctl to driver and block the ip's

v_kalv_kal Member Posts: 15

I want to send ip adresses stored in json file to wfp driver and block those ip's. But I am not getting how can I pass the buffer from
buffer = Irp->AssociatedIrp.SystemBuffer; to the clasifyfn or Addfilter function to match the ips.


  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,653

    Global variable? Or am I missing something?


  • MBond2MBond2 Member Posts: 631

    are you asking how to parse JSON in KM? or how to make a copy of the memory passed in an IRP that you can then use in another context?

  • v_kalv_kal Member Posts: 15

    My fault, I was trying to parse the json (using user mode libraries) in kernel mode.
    I did it by parsing json in user application and then send the data.

  • MBond2MBond2 Member Posts: 631

    It should be noted that parsing JSON in KM is also doable. Just like any other string format, the key is to understand the bounding conditions and create a state machine for the expected format. The central problem is always what to do when the data supplied is not in the expected format. UM implementations usually have features based on runtime type information, and usually fail by throwing exceptions, but a KM version has to expect specific elements and fail in a structured way. Once those requirements are certain, it is usually as simple as a while(i < len) loop with some state variables. Some prefer for loops, but I hate that idiom

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 26 Feb - 1 Mar 2024 Live, Online