R.Wieser
2018-05-27 13:32:27 UTC
Hello all,
As WM_COPYDATA seems only to be able to transfer *to* another process (and
not from / both ways) I thought it would be a good idea to see if I could
create a 'shared memory' solution.
Using CreateFileMapping/OpenFileMapping and CreateViewOfFile works alright
(for both "sending" as well as "receiving") as long as I use a "filename".
But when I tried to go the "unnamed memory object" way I got stuck after
transferring the CreateFileMapping handle to another process. No matter
what I try, I cannot get the DuplicateHandle to give me anything else than a
"6 - invalid handle" result.
Even just trying to duplicate the senders process handle returned the above
error. :-\
And yes, before sending it I first converted the "GetCurrentProcess" pseudo
handle (-1) to a real one (using
DuplicateHandle,GetCurrentProcess(),GetCurrentProcess(),GetCurrentProcess(),&hProcessRealHandle,0,1,DUPLICATE_SAME_ACCESS
) :-)
Help ?
Regards
Rudy Wieser
As WM_COPYDATA seems only to be able to transfer *to* another process (and
not from / both ways) I thought it would be a good idea to see if I could
create a 'shared memory' solution.
Using CreateFileMapping/OpenFileMapping and CreateViewOfFile works alright
(for both "sending" as well as "receiving") as long as I use a "filename".
But when I tried to go the "unnamed memory object" way I got stuck after
transferring the CreateFileMapping handle to another process. No matter
what I try, I cannot get the DuplicateHandle to give me anything else than a
"6 - invalid handle" result.
Even just trying to duplicate the senders process handle returned the above
error. :-\
And yes, before sending it I first converted the "GetCurrentProcess" pseudo
handle (-1) to a real one (using
DuplicateHandle,GetCurrentProcess(),GetCurrentProcess(),GetCurrentProcess(),&hProcessRealHandle,0,1,DUPLICATE_SAME_ACCESS
) :-)
Help ?
Regards
Rudy Wieser