January 19th, 2007

What does the fCreate parameter to SHCreateStreamOnFileEx mean?

The documentation for the fCreate parameter for the SHCreateStreamOnFileEx function covers the issue, but since people seem to really like charts and tables, I’ll present the same information in tabular form.

grfMode fCreate File exists? Behavior
STGM_CREATE (ignored) Yes File is opened (old contents lost)
STGM_CREATE (ignored) No File is created
STGM_FAILIFTHERE FALSE Yes File is opened (old contents preserved)
STGM_FAILIFTHERE FALSE No Fails
STGM_FAILIFTHERE TRUE Yes Fails
STGM_FAILIFTHERE TRUE No File is created
Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.