Search code examples
c++winapicomwindowole

Is there a number limit on opened win32 IStream object for IStorage created with StgCreateStorageEx?


I create an IStorage by StgCreateStorageEx function, with type: STGFMT_STORAGE.

Then I used the CreateStream method to create IStream objects (around 60).

I didn't call Release on all of the IStream interfaces, but when I call Seek on some of them, it returns STG_E_REVERTED.

However, if I create them and use them one by one, it works properly.

Does anyone know why?

Is there a limit?


Solution

  • MSDN says:

    • The STGM_DELETEONRELEASE flag is not supported.
    • Opening the same stream more than once from the same storage is not supported. The STGM_SHARE_EXCLUSIVE sharing-mode flag must be specified in the grfMode parameter.

    Did you release these streams before?