Reading/writing data from a pipe
Posted: Mon Jun 18, 2007 8:12 pm
I am looking to include an image file as a binary, and then be able to decode it.
What i have come up with is using named pipes. However, i can't seem to get the data in the memory buffer written to the pipe.
What i need to do is create a pipe, spit out the binary data, and then be able to read it just like i would any other file, and decode the GIf image.
Any ideas on how to do this?
What i have come up with is using named pipes. However, i can't seem to get the data in the memory buffer written to the pipe.
Code: Select all
ImageSize = ?giffileend-?giffile
pipe = CreateNamedPipe_("\\.\pipe\ImageDataPipe",#PIPE_ACCESS_INBOUND|#FILE_FLAG_OVERLAPPED,#PIPE_TYPE_BYTE|#PIPE_READMODE_BYTE|#PIPE_NOWAIT,1,ImageSize,ImageSize,#NMPWAIT_USE_DEFAULT_WAIT,#Null)
Debug pipe
OpenFile(0,"\\.\pipe\ImageDataPipe")
WriteData(0,?giffile,ImageSize)
CloseFile(0)
Debug ReadFile(0,"ImageDataPipe")
Debug ReadByte(0)
CloseFile(0)
CloseHandle_(ImageDataPipe)
Any ideas on how to do this?