title: Windows c++ service faulting on ucrtbase.dll when starting
body: <p>So I've been developing this program for a while now... Its meant to act as an asset manager (and potentially more in the future) for our IT team. I have 2 services which we'll refer to as "Manager" and "IAM" for right now. The "Manager" does all things managerial for all services (currently only the inventory asset manager known as "IAM") such as automatic updates, etc., while the asset manager does its job.</p>
  
  <p>Anyways, its been working great for a while now. Recently I implemented an automatic updating feature (actually still needing to be tested and likely debugged). While doing this, I needed to get my naming consistent (for example, renaming my service from "Updater" and "CppWindowsService" to the software's actual name).</p>
  
  <p>Before this, it had been working great! Started, stopped, installed, and uninstalled with no hiccups. I change the name for everything, and make sure it all compiles ok. Looks good. Install works great for both "Manager" and "IAM" now, but as soon as I try to start it, I get: </p>
  
  <blockquote>
    <p>StartService failed (1053)</p>
  </blockquote>
  
  <p>Also, when I try to start it from services.msc, then I get the following error message:</p>
  
  <blockquote>
    <p>Windows could not start the  service on Local Computer.</p>
    
    <p>Error 1053:  The service did not respond to the start or control request in a timely fashion</p>
  </blockquote>
  
  <p>The strange thing about this though is that it doesn't wait for any sort of timeout.  It just instantly spits out the message.  That message comes from the code called from my wmain() (windows entry point.  <code>main()</code> otherwise.) function.</p>
  
  <pre><code>if (!StartService(
          schService,  // handle to service 
          0,           // number of arguments 
          NULL))      // no arguments 
      {
          printf("StartService failed (%d)\n", GetLastError());
          CloseServiceHandle(schService);
          CloseServiceHandle(schSCManager);
          return;
      }
      else printf("Service start pending...\n");
  </code></pre>
  
  <p>In Windows Event Log, I get an application error containing the following details after fault.</p>
  
  <blockquote>
    <p>Faulting application name: InITManager.exe, version: 0.0.0.0, time stamp: 0x59e11e44</p>
    
    <p>Faulting module name: ucrtbase.dll, version: 10.0.15063.674, time stamp: 0x8ac9f9d4</p>
    
    <p>Exception code: 0xc0000409</p>
    
    <p>Fault offset: 0x000000000007350e</p>
    
    <p>Faulting process id: 0x3008</p>
    
    <p>Faulting application start time: 0x01d346915918e17d</p>
    
    <p>Faulting application path: 
    C:\Users\collin.walker\Desktop\InITService\C++\x64\Release\Manager.exe</p>
    
    <p>Faulting module path: C:\WINDOWS\System32\ucrtbase.dll</p>
    
    <p>Report Id: 7fcbdcc4-be8e-476a-960f-4fa1fb21f892</p>
    
    <p>Faulting package full name: </p>
    
    <p>Faulting package-relative application ID: </p>
  </blockquote>
  
  <p>Other info:  ucrtbase.dll is used by Visual Studio and is associated with the Release build, where as ucrtbased.dll is associated with the debugger build.  I am building in Release mode.</p>
  
  <p>Now, I've already been told the issue isn't my code, but if anyone feels as though they need to see it, I will include it then.  Its very straightforward c++ winapi stuff though.</p>
  
  <p>If anyone has any further suggestions on how to troubleshoot this, please let me know, and thanks for all help in advance!</p>