{"id":43193,"date":"2015-01-08T07:00:00","date_gmt":"2015-01-08T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2015\/01\/08\/what-happens-if-i-dont-pass-a-pcreateexparams-to-createfile2\/"},"modified":"2015-01-08T07:00:00","modified_gmt":"2015-01-08T07:00:00","slug":"what-happens-if-i-dont-pass-a-pcreateexparams-to-createfile2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20150108-00\/?p=43193","title":{"rendered":"What happens if I don&#039;t pass a pCreateExParams to CreateFile2?"},"content":{"rendered":"<p>\nThe final\n<code>pCreateExParams<\/code> parameter to\n<a HREF=\"http:\/\/msdn.microsoft.com\/library\/hh449422\">\nthe\n<code>CreateFile2<\/code> function<\/a>\nis optional.\nWhat happens if I pass <code>NULL<\/code>?\n<\/p>\n<p>\nIf you pass <code>NULL<\/code> as the\n<code>pCreateExParams<\/code> parameter,\nthen the function behaves as if you had passed\na pointer to this structure:\n<\/p>\n<pre>\nCREATEFILE2_EXTENDED_PARAMETERS defaultCreateExParams =\n{\n sizeof(defaultCreateExParameters), \/\/ dwSize\n 0, \/\/ dwFileAttributes\n 0, \/\/ dwFileFlags\n 0, \/\/ dwSecurityQosFlags\n NULL, \/\/ lpSecurityAttributes\n NULL, \/\/ hTemplateFile\n};\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The final pCreateExParams parameter to the CreateFile2 function is optional. What happens if I pass NULL? If you pass NULL as the pCreateExParams parameter, then the function behaves as if you had passed a pointer to this structure: CREATEFILE2_EXTENDED_PARAMETERS defaultCreateExParams = { sizeof(defaultCreateExParameters), \/\/ dwSize 0, \/\/ dwFileAttributes 0, \/\/ dwFileFlags 0, \/\/ dwSecurityQosFlags NULL, [&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-43193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>The final pCreateExParams parameter to the CreateFile2 function is optional. What happens if I pass NULL? If you pass NULL as the pCreateExParams parameter, then the function behaves as if you had passed a pointer to this structure: CREATEFILE2_EXTENDED_PARAMETERS defaultCreateExParams = { sizeof(defaultCreateExParameters), \/\/ dwSize 0, \/\/ dwFileAttributes 0, \/\/ dwFileFlags 0, \/\/ dwSecurityQosFlags NULL, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/43193","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=43193"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/43193\/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=43193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=43193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=43193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}