{"id":28343,"date":"2007-01-19T10:00:01","date_gmt":"2007-01-19T10:00:01","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2007\/01\/19\/what-does-the-fcreate-parameter-to-shcreatestreamonfileex-mean\/"},"modified":"2007-01-19T10:00:01","modified_gmt":"2007-01-19T10:00:01","slug":"what-does-the-fcreate-parameter-to-shcreatestreamonfileex-mean","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20070119-01\/?p=28343","title":{"rendered":"What does the fCreate parameter to SHCreateStreamOnFileEx mean?"},"content":{"rendered":"<p> The documentation for the <code>fCreate<\/code> parameter for the <code>SHCreateStreamOnFileEx<\/code> function covers the issue, but since people seem to really like charts and tables, I&#8217;ll present the same information in tabular form. <\/p>\n<table>\n<col span=\"3\" style=\"padding-right: 1em\">\n<tr>\n<th>grfMode<\/th>\n<th>fCreate<\/th>\n<th>File exists?<\/th>\n<th>Behavior<\/th>\n<\/tr>\n<tr>\n<td>STGM_CREATE<\/td>\n<td>(ignored)<\/td>\n<td>Yes<\/td>\n<td>File is opened (old contents lost)<\/td>\n<\/tr>\n<tr>\n<td>STGM_CREATE<\/td>\n<td>(ignored)<\/td>\n<td>No<\/td>\n<td>File is created<\/td>\n<\/tr>\n<tr>\n<td>STGM_FAILIFTHERE<\/td>\n<td>FALSE<\/td>\n<td>Yes<\/td>\n<td>File is opened (old contents preserved)<\/td>\n<\/tr>\n<tr>\n<td>STGM_FAILIFTHERE<\/td>\n<td>FALSE<\/td>\n<td>No<\/td>\n<td>Fails<\/td>\n<\/tr>\n<tr>\n<td>STGM_FAILIFTHERE<\/td>\n<td>TRUE<\/td>\n<td>Yes<\/td>\n<td>Fails<\/td>\n<\/tr>\n<tr>\n<td>STGM_FAILIFTHERE<\/td>\n<td>TRUE<\/td>\n<td>No<\/td>\n<td>File is created<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>The documentation for the fCreate parameter for the SHCreateStreamOnFileEx function covers the issue, but since people seem to really like charts and tables, I&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-28343","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>The documentation for the fCreate parameter for the SHCreateStreamOnFileEx function covers the issue, but since people seem to really like charts and tables, I&#8217;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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/28343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=28343"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/28343\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=28343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=28343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=28343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}