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 |
0 comments