NetShareEnum Timeout
<p>The process for <code>NetShareEnum</code> sometimes takes upwards of 30 seconds, successful connections generally take less than a second, is there any way to set a manual timeout time? </p>

<p>The <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb525387(v=vs.85).aspx" rel="nofollow">documentation</a> is quite silent on the subject. The <a href="https://msdn.microsoft.com/en-us/library/cc240321.aspx" rel="nofollow">protocol</a> includes a timeout that seems to be the actual connection timeout instead of a failure timeout. I found <a href="http://blogs.msdn.com/b/openspecification/archive/2013/03/19/cifs-and-smb-timeouts-in-windows.aspx" rel="nofollow">SMB timeouts</a>, which seem to be configurable to a degree (via registry settings) but I'd rather not mess up the default timeouts for a user.</p>

<p>If we can't set a manual timeout- is it acceptable to spawn a worker thread to run the process and kill that thread after a custom timeout (using <code>WaitForSingleObject</code> and <code>TerminateThread</code>)? Is there any possibility of crashing due to killing a thread running only that process?</p>