Exemplo n.º 1
0
 private void BeginUnicodeOutput()
 {
     this.unicodePipeReadHandle  = (SafeFileHandle)null;
     this.unicodePipeWriteHandle = (SafeFileHandle)null;
     this.unicodeOutputEnded     = (AutoResetEvent)null;
     if (!this.UseUnicodeOutput)
     {
         return;
     }
     if (NativeMethodsShared.CreatePipe(out this.unicodePipeReadHandle, out this.unicodePipeWriteHandle, new NativeMethodsShared.SecurityAttributes()
     {
         lpSecurityDescriptor = NativeMethodsShared.NullIntPtr,
         bInheritHandle = true
     }, 0))
     {
         List <string> list = new List <string>();
         if (this.EnvironmentVariables != null)
         {
             list.AddRange((IEnumerable <string>) this.EnvironmentVariables);
         }
         list.Add("VS_UNICODE_OUTPUT=" + this.unicodePipeWriteHandle.DangerousGetHandle().ToString());
         this.EnvironmentVariables = list.ToArray();
         this.unicodeOutputEnded   = new AutoResetEvent(false);
         ThreadPool.QueueUserWorkItem(new WaitCallback(this.ReadUnicodeOutput));
     }
     else
     {
         this.Log.LogWarningWithCodeFromResources("TrackedVCToolTask.CreateUnicodeOutputPipeFailed", (object)this.ToolName);
     }
 }