Click here to Skip to main content
15,867,686 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy18-Jan-11 3:06
professionalChesnokov Yuriy18-Jan-11 3:06 
GeneralRe: How to pin List to unmanaged byte** Pin
_Erik_18-Jan-11 3:17
_Erik_18-Jan-11 3:17 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy18-Jan-11 3:20
professionalChesnokov Yuriy18-Jan-11 3:20 
GeneralRe: How to pin List to unmanaged byte** Pin
_Erik_18-Jan-11 3:47
_Erik_18-Jan-11 3:47 
GeneralRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy18-Jan-11 8:07
professionalChesnokov Yuriy18-Jan-11 8:07 
GeneralRe: How to pin List to unmanaged byte** Pin
DaveyM6918-Jan-11 16:50
professionalDaveyM6918-Jan-11 16:50 
GeneralRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy18-Jan-11 19:16
professionalChesnokov Yuriy18-Jan-11 19:16 
GeneralRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 1:01
professionalDaveyM6919-Jan-11 1:01 
Chesnokov Yuriy wrote:
byte[] arrays can be of variable length. it will not be possible to create byte[][] from them.


you can create a byte[1][] from a byte[] as the method I posted shows, regardless of the Length of byte[].


Chesnokov Yuriy wrote:
but there will be no trouble if you alter the bytes of the array in unmanaged side.
they are passed as pointers, thus unmanaged application can modify them.


Yes, exactly my point. IIRC arrays are copied to unmanaged memory when passed using PInvoke and then managed memory is updated when the function returns, hence my suggestion to recreate the List when the function returns. All instances of the List will then reflect the changed date.
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



QuestionRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 1:25
professionalChesnokov Yuriy19-Jan-11 1:25 
AnswerRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 2:40
professionalDaveyM6919-Jan-11 2:40 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 3:00
professionalChesnokov Yuriy19-Jan-11 3:00 
QuestionRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 4:13
professionalChesnokov Yuriy19-Jan-11 4:13 
AnswerRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 5:43
professionalDaveyM6919-Jan-11 5:43 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 9:28
professionalChesnokov Yuriy19-Jan-11 9:28 
GeneralRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 9:31
professionalDaveyM6919-Jan-11 9:31 
AnswerRe: How to pin List to unmanaged byte** [modified] Pin
DaveyM6919-Jan-11 8:48
professionalDaveyM6919-Jan-11 8:48 
AnswerRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 9:23
professionalDaveyM6919-Jan-11 9:23 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 9:35
professionalChesnokov Yuriy19-Jan-11 9:35 
GeneralRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 9:41
professionalDaveyM6919-Jan-11 9:41 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 10:04
professionalChesnokov Yuriy19-Jan-11 10:04 
GeneralRe: How to pin List to unmanaged byte** Pin
DaveyM6919-Jan-11 10:14
professionalDaveyM6919-Jan-11 10:14 
AnswerRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 19:02
professionalChesnokov Yuriy19-Jan-11 19:02 
GeneralRe: How to pin List to unmanaged byte** Pin
_Erik_19-Jan-11 3:06
_Erik_19-Jan-11 3:06 
GeneralRe: How to pin List to unmanaged byte** Pin
Chesnokov Yuriy19-Jan-11 4:18
professionalChesnokov Yuriy19-Jan-11 4:18 
GeneralRe: How to pin List to unmanaged byte** Pin
_Erik_19-Jan-11 5:10
_Erik_19-Jan-11 5:10 

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.