<div class="content"><p> </p><p>The SchRpcScheduledRuntimes method MUST return scheduled run
times.</p><dl>
<dd>
<div><pre> HRESULT SchRpcScheduledRuntimes(
   [in, string] const wchar_t* path,
   [in, unique] PSYSTEMTIME start,
   [in, unique] PSYSTEMTIME end,
   [in] DWORD flags,
   [in] DWORD cRequested,
   [out] DWORD* pcRuntimes,
   [out, size_is(, *pcRuntimes)] PSYSTEMTIME* pRuntimes
 );
</pre></div>
</dd></dl><p><b>path: </b>MUST contain the full path to a task
using the format specified in section <span><a href="fa8809c8-4f0f-4c6d-994a-6c10308757c1" data-linktype="relative-path">2.3.11</a></span>.</p><p><b>start: </b>If non-NULL, MUST specify the start of
a time interval. If NULL, the server MUST calculate <span><a href="efc35aa8-1f40-4609-869a-107dd31bbed0#gt_27bc9cf2-5c63-4e78-8a9b-d69d6ada55c6" data-linktype="relative-path">scheduled runtimes</a></span>
from the start of time, where the start of time is the smallest time value that
the specific operating system implements.</p><p><b>end: </b>If non-NULL, MUST specify the end of a
time interval. If NULL, the server MUST calculate scheduled runtimes to the end
of time, where the end of time is the largest time value that the specific
operating system implements.</p><p><b>flags: </b>Unused. The client MUST specify 0, and
the server MUST return an error if nonzero.</p><p><b>cRequested: </b>MUST contain the number of
scheduled runtimes requested.</p><p><b>pcRuntimes: </b>MUST contain the number of
runtimes actually returned. The server MUST NOT return more than <i>cRequested</i>
runtimes.</p><p><b>pRuntimes: </b>MUST be a pointer to an array of
scheduled runtimes. The server MUST return the first <i>pcRuntimes</i> runtimes
in the specified time interval.</p><p><b>Return Values: </b>For more information on return
codes, see section <span><a href="774cd43a-8376-4c8b-a2e3-57aaa6357088" data-linktype="relative-path">2.3.14</a></span>, or Win32
Error Codes in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/0642cb2f-2075-4469-918c-4441e69c548a" data-linktype="relative-path">2.1</a></span>.</p><p>Upon receipt of the SchRpcScheduledRuntimes call that
requires the server to return the state of the scheduled instances of a task,
the server MUST:</p><ul><li><p><span><span> 
</span></span>Return E_INVALIDARG if any of the following are true:</p>
<ul><li><p><span><span>  </span></span>The
<i>path</i> parameter is NULL.</p>
</li><li><p><span><span>  </span></span>The
<i>flags</i> parameter is nonzero.</p>
</li><li><p><span><span>  </span></span>The
<i>pcRuntimes</i> parameter is NULL.</p>
</li><li><p><span><span>  </span></span>The
<i>pRuntimes</i> parameter is NULL.</p>
</li></ul><p><b>Note</b>  When
passing NULL as a value for parameters, behavior can change based upon the RPC
Runtime Check, as specified in <span><a href="535bb46d-f599-4528-9b02-eb2d391fd361" data-linktype="relative-path">RPC Runtime Check
Notes (section 3.3)</a></span>.</p>
</li><li><p><span><span> 
</span></span>Return the value 0x8007007B, the <span><a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a></span>
form of the Win32 error <b>ERROR_INVALID_NAME</b>, if the specified <i>path</i>
is not in the format specified in section 2.3.11.</p>
</li><li><p><span><span> 
</span></span>Return the value 0x80070003, the HRESULT form of the Win32 error
ERROR_PATH_NOT_FOUND, if the specified <i>path</i> does not exist on the server
in the <span><a href="efc35aa8-1f40-4609-869a-107dd31bbed0#gt_982b7f8e-d516-4fd5-8d5e-1a836081ed85" data-linktype="relative-path">XML</a></span> <span><a href="efc35aa8-1f40-4609-869a-107dd31bbed0#gt_08035fe7-a786-4b30-ab60-3fd046060617" data-linktype="relative-path">task
store</a></span>.</p>
</li><li><p><span><span> 
</span></span>Return the HRESULT form of the Win32 error ERROR_FILE_NOT_FOUND,
if the specified task does not exist on the server in the XML task store.</p>
</li><li><p><span><span> 
</span></span>Return E_ACCESSDENIED if the caller does not have read access to
the task.</p>
</li><li><p><span><span> 
</span></span>Retrieve the task definition from the XML task store and compute
all the scheduled runtimes between start and end parameters, up to the number <i>cRequested</i>.
If the start parameter is NULL, the computation MUST start at the beginning of
time. If the end parameter is NULL, the computation MUST continue to the end of
time.</p>
</li><li><p><span><span> 
</span></span>The server MUST NOT compute more than <i>cRequested</i> scheduled
runtimes and MUST compute as many scheduled runtimes as are available, up to a
total of <i>cRequested</i> scheduled runtimes.<a id="Appendix_A_Target_80"></a><a aria-label="Product behavior note 80" href="2d1fbbab-fe6c-4ae5-bdf5-41dc526b2439#Appendix_A_80" data-linktype="relative-path">&lt;80&gt;</a></p>
</li><li><p><span><span> 
</span></span>The server MUST return the computed runtimes in the <i>pRuntimes</i>
parameter.</p>
</li><li><p><span><span> 
</span></span>The server MUST return the number of computed runtimes in the <i>pcRuntimes</i>
parameter.</p>
</li><li><p><span><span> 
</span></span>Depending upon the situation, the server MUST return:</p>
<ul><li><p><span><span>  </span></span>S_OK
if there were scheduled runs in the given time window and all were returned.</p>
</li><li><p><span><span>  </span></span>S_FALSE
if there were scheduled runs in the given time window but some were not
returned.</p>
</li><li><p><span><span>  </span></span>SCHED_S_TASK_NO_MORE_RUNS
if no runs are scheduled in given time window.</p>
</li><li><p><span><span>  </span></span>SCHED_S_TASK_NOT_SCHEDULED
if the task has no time-based triggers.</p>
</li></ul></li></ul></div>