Click here to Skip to main content
14,868,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
Randor 8-Mar-21 11:50
professional Randor 8-Mar-21 11:50 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
Gerry Schmitz9-Mar-21 8:16
mveGerry Schmitz9-Mar-21 8:16 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
Randor 9-Mar-21 10:24
professional Randor 9-Mar-21 10:24 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
BobZscharnagk10-Mar-21 14:09
MemberBobZscharnagk10-Mar-21 14:09 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
Randor 10-Mar-21 16:54
professional Randor 10-Mar-21 16:54 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
BobZscharnagk10-Mar-21 19:30
MemberBobZscharnagk10-Mar-21 19:30 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
BobZscharnagk10-Mar-21 22:40
MemberBobZscharnagk10-Mar-21 22:40 
GeneralRe: How to pass an array or structs to DeviceIoControl when using pinvoke Pin
Randor 10-Mar-21 23:08
professional Randor 10-Mar-21 23:08 
Yep.

In my code sample I gave you you can add:
for (int i = 0; i < count; i++)
{
    IntPtr ptr= new IntPtr(lpOutBuffer.ToInt64() + i * Marshal.SizeOf(typeof(FILE_ALLOCATED_RANGE_BUFFER)));
    response[i] = Marshal.PtrToStructure<FILE_ALLOCATED_RANGE_BUFFER>(ptr);
}
Under the call to DeviceIoControl to marshal the unmanaged array.

I am a Windows API guy... I got involved to help you figure out why DeviceIoControl was giving you an ERROR_ACCESS_DENIED. Didn't know I would need to fix your C# code too. Smile | :)

Glad you got it working, good luck. Big Grin | :-D

Best Wishes,
-David Delaune
QuestionUser Control Pin
Member 147923937-Mar-21 9:17
MemberMember 147923937-Mar-21 9:17 
AnswerRe: User Control Pin
OriginalGriff7-Mar-21 11:20
mveOriginalGriff7-Mar-21 11:20 
GeneralRe: User Control Pin
Member 147923938-Mar-21 1:50
MemberMember 147923938-Mar-21 1:50 
GeneralRe: User Control Pin
OriginalGriff8-Mar-21 2:45
mveOriginalGriff8-Mar-21 2:45 
AnswerRe: User Control Pin
BillWoodruff7-Mar-21 17:03
mveBillWoodruff7-Mar-21 17:03 
GeneralRe: User Control Pin
Member 147923938-Mar-21 1:49
MemberMember 147923938-Mar-21 1:49 
AnswerRe: User Control Pin
Ralf Meier7-Mar-21 22:46
professionalRalf Meier7-Mar-21 22:46 
GeneralRe: User Control Pin
BillWoodruff8-Mar-21 1:07
mveBillWoodruff8-Mar-21 1:07 
GeneralRe: User Control Pin
Member 147923938-Mar-21 1:51
MemberMember 147923938-Mar-21 1:51 
GeneralRe: User Control Pin
Ralf Meier8-Mar-21 5:10
professionalRalf Meier8-Mar-21 5:10 
QuestionHow to take JSON POST data and covert it to something i can work with Pin
jacobarrey4-Mar-21 11:40
Memberjacobarrey4-Mar-21 11:40 
AnswerRe: How to take JSON POST data and covert it to something i can work with Pin
OriginalGriff4-Mar-21 11:45
mveOriginalGriff4-Mar-21 11:45 
GeneralRe: How to take JSON POST data and covert it to something i can work with Pin
jacobarrey5-Mar-21 9:37
Memberjacobarrey5-Mar-21 9:37 
GeneralRe: How to take JSON POST data and covert it to something i can work with Pin
OriginalGriff5-Mar-21 10:57
mveOriginalGriff5-Mar-21 10:57 
AnswerRe: How to take JSON POST data and covert it to something i can work with Pin
smartial_arts17-Mar-21 15:15
Membersmartial_arts17-Mar-21 15:15 
QuestionC# - TCP/IP COMMUNICATIONS Pin
ICARUS9993-Mar-21 9:58
MemberICARUS9993-Mar-21 9:58 
AnswerRe: C# - TCP/IP COMMUNICATIONS Pin
shanda watkins3-Mar-21 10:15
Membershanda watkins3-Mar-21 10:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.