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

Home NTFSD
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: https://www.osr.com/osr-learning-library/


[Kernel-Application communication]

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hello , I am working on sending some data via dma to fpga , my issue is
that i wanted to directly communicate via deviceiocontrol function , i have
almost no experience on this topic , Please any help or info is good .

problem is when i send data i do like this :

DeviceIoControl (hDMADevice, ISTART_TEST_SMUX, DataToSend,
sizeof(TestCmdSMUX), NULL, 0, &bytes, &os))
where DataToSend is pointer to structure i send , with size
= sizeof(TestCmdSMUX).

How can i decode this data in driver itself ? what i did so far is :

case ISTART_TEST_SMUX:
{
TestCmdSMUX * pTC;
if (InputBufferLength >= sizeof(TestCmdSMUX))
{

status = WdfRequestRetrieveInputBuffer(Request, sizeof(TestCmdSMUX),
&pTC, NULL);
if (status == STATUS_SUCCESS)
{
status = SetTestModesmux(pDevExt, pTC );
}
}
}

*DataToSend *is ptr to structure like this :
typedef struct {
int Engine; /**< Engine Number */
unsigned int TestMode; /**< Test Mode - Enable TX, Enable loopback */
unsigned int MinPktSize; /**< Min packet size */
unsigned int MaxPktSize; /**< Max packet size */
UCHAR buffer[1];

} TestCmdSMUX *DataToSend **


*UCHAR buffer[1];* --> this is pointer to first element of my data i want
to send to kernel .


so it isn't working properly , and i don't know why ! , few questions i
have here :
1 - is WdfRequestRetrieveInputBuffer right to use ? and can i in this way
use members of pTC structure ?
2 - what is diffrence between *WdfRequestRetrieveInputBuffer *and
*Irp->AssociatedIrp.SystemBuffer
,when to use them?*
3 - how can i actually recieve the array data i am passing with
deviceiocontrol datatosend structure ?
4 - what is type of my IOCode in this usecase , Method_In_Direct OR
MethodBuffered ?
5 - suppose i want to address in driver the 3rd element data of array
passed , how i do that in driver ?

Thanks so much




--
Mohamed Abdel Rauof.
communication and electronics Engineer Cairo University BSc. 2011.

Comments

  • rod_widdowsonrod_widdowson Member - All Emails Posts: 1,131
    What is this DMA thing of which you speak :-)

    Seriously, you'd be better off asking in NTDEV where the hardwary-types hang
    out...

    /Rod
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    what i mean by dma is sending data to dma* driver* with *deviceiocontrol*.
    it has nothing geenrally with hardware

    thanks

    On Thu, Feb 2, 2017 at 2:45 PM, Rod Widdowson
    wrote:

    > What is this DMA thing of which you speak :-)
    >
    > Seriously, you'd be better off asking in NTDEV where the hardwary-types
    > hang out...
    >
    > /Rod
    >
    >
    > ---
    > NTFSD is sponsored by OSR
    >
    >
    > MONTHLY seminars on crash dump analysis, WDF, Windows internals and
    > software drivers!
    > Details at
    >
    > To unsubscribe, visit the List Server section of OSR Online at <
    > http://www.osronline.com/page.cfm?name=ListServer&gt;
    >



    --
    Mohamed Abdel Rauof.
    communication and electronics Engineer Cairo University BSc. 2011.
  • Don_BurnDon_Burn Member - All Emails Posts: 1,692
    Rod is still correct, this is an NTDEV topic, not NTFSD.





    Don Burn

    Windows Driver Consulting

    Website: http://www.windrvr.com







    From: [email protected] [mailto:[email protected]] On Behalf Of mohamed rauof
    Sent: Thursday, February 02, 2017 7:49 AM
    To: Windows File Systems Devs Interest List
    Subject: Re: [ntfsd] [Kernel-Application communication]



    what i mean by dma is sending data to dma driver with deviceiocontrol.

    it has nothing geenrally with hardware



    thanks



    On Thu, Feb 2, 2017 at 2:45 PM, Rod Widdowson > wrote:

    What is this DMA thing of which you speak :-)

    Seriously, you'd be better off asking in NTDEV where the hardwary-types hang out...

    /Rod


    ---
    NTFSD is sponsored by OSR


    MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
    Details at

    To unsubscribe, visit the List Server section of OSR Online at







    --

    Mohamed Abdel Rauof.
    communication and electronics Engineer Cairo University BSc. 2011.

    --- NTFSD is sponsored by OSR MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at To unsubscribe, visit the List Server section of OSR Online at
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA