<div class="content"><p>The Create method is received by the <a href="3b7be3f7-651c-4f9c-930b-a9a7c4355ad8#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> in an RPC_REQUEST
packet. In response, the server creates a new public or private <a href="7d8d0dab-699c-4121-9ee4-226a2dbced2e" data-linktype="relative-path">ApplicationQueue</a>.</p><dl>
<dd>
<div><pre> HRESULT Create(
   [in, optional] VARIANT* IsTransactional,
   [in, optional] VARIANT* IsWorldReadable
 );
</pre></div>
</dd></dl><p><b>IsTransactional: </b>A <a href="../ms-oaut/a6a540af-38ac-48be-bd40-92e2c01e9aa6" data-linktype="relative-path">VARIANT</a>
pointer to a <a href="../ms-dtyp/51bbfbb1-08e2-4c13-a95e-1eaa7d310670" data-linktype="relative-path">BOOLEAN</a>
value (VT_BOOL) that specifies whether the <a href="3b7be3f7-651c-4f9c-930b-a9a7c4355ad8#gt_c1a6400d-703b-4f9a-a74c-40f1487978d9" data-linktype="relative-path">queue</a> is <a href="3b7be3f7-651c-4f9c-930b-a9a7c4355ad8#gt_61e1de21-a78d-4d20-b184-eda380386871" data-linktype="relative-path">transactional</a>. If the value
is TRUE (0x00000001), the queue is transactional. If the value is FALSE
(0x00000000), the queue is not transactional. If the value is unspecified, the
server MUST assume that this value is FALSE.</p><p><b>IsWorldReadable: </b>A VARIANT pointer to a
BOOLEAN value (VT_BOOL) that, if set to TRUE (0x00000001), specifies that the
queue is accessible to everyone. If the value is not specified, the server MUST
use FALSE (0x00000000), which specifies that the queue will be accessible only
to the owner and system <a href="3b7be3f7-651c-4f9c-930b-a9a7c4355ad8#gt_eb335f5b-619b-46ed-9138-06e9910108c3" data-linktype="relative-path">administrators</a>.</p><p><b>Return Values: </b>The method MUST return S_OK
(0x00000000) on success or an implementation-specific error <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
on failure.</p><p>When processing this call, the server MUST abide by the
following contract:</p><ul><li><p><span><span> 
</span></span>If <b>refQueue</b>.<b>PathName</b> equals NULL:</p>
<ul><li><p><span><span>  </span></span>Return
an error HRESULT, and take no further action.</p>
</li></ul></li><li><p><span><span> 
</span></span>Identify the computer name and the queue name from the <b>refQueue</b>.<b>PathName</b>.</p>
</li><li><p><span><span> 
</span></span>If the computer name or queue name cannot be identified:</p>
<ul><li><p><span><span>  </span></span>Return
an error HRESULT, and take no further action.</p>
</li></ul></li><li><p><span><span> 
</span></span>Define <b>IsLocal</b> as a BOOLEAN value that equals True if the
local <a href="../ms-mqdmpr/9adb2d90-c63b-43c7-9b9c-804ab96a57d5" data-linktype="relative-path">QueueManager</a>.<b>ComputerName</b>
equals the identified computer name.</p>
</li><li><p><span><span> 
</span></span>Define <b>IsPublic</b> as a BOOLEAN value that equals True if the
<a href="../ms-mqdmpr/2e026a09-999e-478f-8c4c-5344b661e579" data-linktype="relative-path">Queue</a>.PathName
instance variable describes a public queue. Otherwise, <b>IsPublic</b> equals
False.</p>
</li><li><p><span><span> 
</span></span>If<b>IsLocal</b> equals False and <b>IsPublic</b> equals False:</p>
<ul><li><p><span><span>  </span></span>Return
an error HRESULT, and take no further action.</p>
</li></ul></li><li><p><span><span> 
</span></span>Define <b>OwnerQueueManager</b> as a QueueManager.</p>
</li><li><p><span><span> 
</span></span>If <b>IsLocal</b> equals True:</p>
<ul><li><p><span><span>  </span></span>Set
<b>OwnerQueueManager</b> to the QueueManager.</p>
</li></ul></li><li><p><span><span> 
</span></span>Else:</p>
<ul><li><p><span><span>  </span></span>Set
<b>OwnerQueueManager</b> to QueueManager for which the <b>ComputerName</b>
property equals the identified computer name.</p>
</li></ul></li><li><p><span><span> 
</span></span>Check whether the <b>OwnerQueueManager</b> has an
ApplicationQueue for which the Pathname property equals the identified queue
name.</p>
</li><li><p><span><span> 
</span></span>If ApplicationQueue exists:</p>
<ul><li><p><span><span>  </span></span>Return
an error HRESULT, and take no further action.</p>
</li></ul></li><li><p><span><span> 
</span></span>Else:</p>
<ul><li><p><span><span>  </span></span>If <b>IsPublic</b>
equals False:</p>
<ul><li><p><span><span> 
</span></span>Perform an access check by invoking the Access Check Algorithm (<a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a>
section <a href="../ms-dtyp/4f1bbcbb-814a-4c70-a11e-2a5b8779a6f9" data-linktype="relative-path">2.5.3.2</a>)
with the following parameters:</p>
</li><li><p><span><span> 
</span></span>SecurityDescriptor: <b>OwnerQueueManager.Security</b>.</p>
</li><li><p><span><span> 
</span></span>Token: the security token of the caller.<a id="Appendix_A_Target_44"></a><a aria-label="Product behavior note 44" href="71c359c3-e9ec-4fe6-a101-aab1eabecdcf#Appendix_A_44" data-linktype="relative-path">&lt;44&gt;</a></p>
</li><li><p><span><span> 
</span></span>Access Request mask: <b>MQSEC_CREATE_QUEUE</b> as defined in
section <a href="../ms-mqmq/e5f0e8f9-d67b-4ac0-93a4-1e7e96e87a8c" data-linktype="relative-path">2.2.24</a>
of <a href="../ms-mqmq/b7cc2590-a617-45df-b6a3-1f31102b36fb" data-linktype="relative-path">[MS-MQMQ]</a>.</p>
</li><li><p><span><span> 
</span></span>Object Tree: NULL.</p>
</li><li><p><span><span> 
</span></span>PrincipalSelfSubst SID: NULL.</p>
</li></ul></li><li><p><span><span>  </span></span>If
the Access Check Algorithm does not return success:</p>
<ul><li><p><span><span> 
</span></span>Return an error HRESULT, and take no further action.</p>
</li></ul></li></ul></li><li><p><span><span> 
</span></span>Instantiate a new Queue object, referred to as <b>newQueue</b>.
Copy all attributes of <b>refQueue</b> over to <b>newQueue</b>.</p>
</li><li><p><span><span> 
</span></span>Set <b>newQueue</b>.Transactional to the value of the <i>IsTransactional</i>
input parameter.</p>
</li><li><p><span><span> 
</span></span>Set the security descriptor in <b>newQueue</b>.Security according
to the steps in section <a href="488f05a9-1475-4212-9634-3ddf4697dff4" data-linktype="relative-path">3.10.4.1.26.1</a></p>
</li><li><p><span><span> 
</span></span>Generate the CreateQueue (<a href="../ms-mqdmpr/5eafe0a6-a22f-436b-a0d9-4cbc25c52b47" data-linktype="relative-path">[MS-MQDMPR]</a>
section <a href="../ms-mqdmpr/117b91a6-d5b8-4667-9c3d-e38e1d48bcb2" data-linktype="relative-path">3.1.7.1.3</a>)
event with the following arguments:</p>
<ul><li><p><span><span>  </span></span><i>iQueue</i>
= MUST be set to a reference to <b>newQueue</b>.</p>
</li><li><p><span><span>  </span></span><i>iSkipDirectory</i>
= False.</p>
</li></ul></li><li><p><span><span> 
</span></span>If the CreateQueue event does not return success:</p>
<ul><li><p><span><span>  </span></span>Return
an <i>rStatus</i> status code, and take no further action.</p>
</li></ul></li><li><p><span><span> 
</span></span>Set <b>IsQueueCreated</b> to True.</p>
</li><li><p><span><span> 
</span></span>Set <b>IsApplicationQueue</b> to True.</p>
</li><li><p><span><span> 
</span></span>Return S_OK (0x00000000), and take no further action.</p>
</li></ul></div>