Unless you need a specific byte packing b/c you are creating a structure that represents hardware registers or you are sending it over a network, you typically do not use 1 byte packing and leave the structure at its natural alignment. You can see performance degradation on certain processors when you access 2- or 4- or 8- byte fields that are not naturally aligned for their respective sizes.
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of nayan kumar
Sent: Sunday, October 28, 2007 10:07 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Ctl code problem
Hi ,
Thanks for your reply.
Acyually i was using pragma pack(push,1) in user mode code because of which i was not getting the proper value in the driver .
if we are using this in driver is it same like it behave in user mode application .
If you can throw some light about advantage and disadvantage of using this in driver or can give some pointer or link of tutorial which describes about this as far as using this in driver i would be very thankfull to you.
Regards
From: xxxxx@microsoft.com
To: xxxxx@lists.osr.com
Date: Fri, 26 Oct 2007 18:32:02 -0700
Subject: RE: [ntdev] Ctl code problem
Show us the user mode code, the issue may be there.
d
Sent using my smartphone, apologies forany typos
-----Original Message-----
From: “nayan kumar”
To: “Windows System Software Devs Interest List”
Sent: 10/26/07 6:09 PM
Subject: [ntdev] Ctl code problem
Hi All,
I am trying to pass some input data to driver through ctl code based on input data driver is supposed to do read and write operation .
Although i am getting the ctl code but with some garbage value not the actual value that i am passing from user mode.
I want to know in which condition this kind of problem are likely to happen and what i should do so that i can overcome from this problem.
Just for cheking i tried every combination like METHOD_BUFFERED,METHOD_IN_DIRECT,METHOD_OUT_DIRECT with FILE_READ_ACCESS,
FILE_WRITE_ACCESS in every case i am getting the ctl code but with garbage value.
i set the flags as DO_BUFFERED_IO in add device.
Regards
Call friends with PC-to-PC calling – FREE Try it now!http:
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Call friends with PC-to-PC calling – FREE Try it now!http:
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</http:></http:>