On 10/31/18 3:39 PM, Sven Baars wrote:
On 30-10-18 02:12, Zebediah Figura wrote:
On 10/29/18 5:26 PM, Sven Baars wrote:
+HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE openmode, MF_FILE_FLAGS flags, + LPCWSTR url, IMFByteStream **bytestream) +{ + mfbytestream *object;
+ FIXME("(%d, %d, %d, %s, %p): stub\n", accessmode, openmode, flags, debugstr_w(url), bytestream);
+ object = heap_alloc( sizeof(*object) ); + if(!object) + return E_OUTOFMEMORY;
+ object->ref = 1; + object->IMFByteStream_iface.lpVtbl = &mfbytesteam_vtbl; + MFCreateAttributes(&object->attributes, 0); *bytestream = &object->IMFByteStream_iface; return S_OK; }
I think it probably wouldn't be too difficult to implement this directly on top of MFCreateMFByteStreamOnStream, using SHCreateStreamOnFile(). Obviously the latter doesn't do anything yet, but the implementation seems pretty clear.
Hi Zebediah,
I am now working on implementing this, but unfortunately SHCreateStreamOnFileEx is insufficient for the flags that can be passed to MFCreateFile. I instead parse the flags so they can be passed to CreateFileW as is also done in SHCreateStreamOnFileEx. However, SHCreateStreamOnFileEx calls IStream_Create from the same file, but this function is not exposed. Is there any way to get access to the IStream interface defined in shlwapi/istream.c or does the same interface have to be implemented in/copied to mfplat? Or should I just stop at the point where the file is created for the moment since MFCreateMFByteStreamOnStream doesn't do anything yet anyway?
Best, Sven
My apologies; I seem to have overlooked some of the missing flags. I'm not sure what the best way to proceed is, but I suppose it's best for now just to create a stub IMFByteStream, as your original patch has.