diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index e242d3455ab..3fdf5b73a69 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs @@ -242,9 +242,7 @@ private bool VerifyTemplate(EventMetadata emd) IgnoreProcessingInstructions = true, MaxCharactersInDocument = 0, // no limit ConformanceLevel = ConformanceLevel.Fragment, -#if !CORECLR - XmlResolver = null, -#endif + XmlResolver = null }; int definedParameterCount = 0; diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index cf08ea831cc..a9933122926 100644 --- a/src/Microsoft.WSMan.Management/CredSSP.cs +++ b/src/Microsoft.WSMan.Management/CredSSP.cs @@ -330,15 +330,6 @@ private void DeleteDelegateSettings(string applicationname, RegistryKey rootKey, /// protected override void BeginProcessing() { -#if !CORECLR - if (Environment.OSVersion.Version.Major < 6) - { - //OS is XP/Win2k3. Throw error. - WSManHelper helper = new WSManHelper(this); - string message = helper.FormatResourceMsgFromResourcetext("CmdletNotAvailable"); - throw new InvalidOperationException(message); - } -#endif //If not running elevated, then throw an "elevation required" error message. WSManHelper.ThrowIfNotAdministrator(); @@ -440,14 +431,6 @@ protected override void BeginProcessing() //If not running elevated, then throw an "elevation required" error message. WSManHelper.ThrowIfNotAdministrator(); helper = new WSManHelper(this); -#if !CORECLR - if (Environment.OSVersion.Version.Major < 6) - { - //OS is XP/Win2k3. Throw error. - string message = helper.FormatResourceMsgFromResourcetext("CmdletNotAvailable"); - throw new InvalidOperationException(message); - } -#endif // DelegateComputer cannot be specified when Role is other than client if ((delegatecomputer != null) && !Role.Equals(Client, StringComparison.OrdinalIgnoreCase)) @@ -671,11 +654,7 @@ private void UpdateGPORegistrySettings(string applicationname, string[] delegate //open the registry key.If key is not present,create a new one Credential_Delegation_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation, true); if (Credential_Delegation_Key == null) - Credential_Delegation_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation -#if !CORECLR - , RegistryKeyPermissionCheck.ReadWriteSubTree -#endif - ); + Credential_Delegation_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation, RegistryKeyPermissionCheck.ReadWriteSubTree); Credential_Delegation_Key.SetValue(helper.Key_Allow_Fresh_Credentials, 1, RegistryValueKind.DWord); Credential_Delegation_Key.SetValue(helper.Key_Concatenate_Defaults_AllowFresh, 1, RegistryValueKind.DWord); @@ -683,11 +662,7 @@ private void UpdateGPORegistrySettings(string applicationname, string[] delegate // add the delegate value Allow_Fresh_Credential_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, true); if (Allow_Fresh_Credential_Key == null) - Allow_Fresh_Credential_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials -#if !CORECLR - , RegistryKeyPermissionCheck.ReadWriteSubTree -#endif - ); + Allow_Fresh_Credential_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, RegistryKeyPermissionCheck.ReadWriteSubTree); if (Allow_Fresh_Credential_Key != null) { @@ -833,17 +808,7 @@ protected override void BeginProcessing() { //If not running elevated, then throw an "elevation required" error message. WSManHelper.ThrowIfNotAdministrator(); - helper = new WSManHelper(this); -#if !CORECLR - if (Environment.OSVersion.Version.Major < 6) - { - //OS is XP/Win2k3. Throw error. - string message = helper.FormatResourceMsgFromResourcetext("CmdletNotAvailable"); - throw new InvalidOperationException(message); - } -#endif - IWSManSession m_SessionObj = null; try { diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index 89c8c52afa0..2ccd09abc6e 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -987,17 +987,14 @@ internal bool ValidateCredSSPRegistry(bool AllowFreshCredentialsValueShouldBePre { RegistryKey rGPOLocalMachineKey = Registry.LocalMachine.OpenSubKey( Registry_Path_Credentials_Delegation + @"\CredentialsDelegation", -#if !CORECLR RegistryKeyPermissionCheck.ReadWriteSubTree, -#endif System.Security.AccessControl.RegistryRights.FullControl); if (rGPOLocalMachineKey != null) { - rGPOLocalMachineKey = rGPOLocalMachineKey.OpenSubKey(Key_Allow_Fresh_Credentials, -#if !CORECLR + rGPOLocalMachineKey = rGPOLocalMachineKey.OpenSubKey( + Key_Allow_Fresh_Credentials, RegistryKeyPermissionCheck.ReadWriteSubTree, -#endif System.Security.AccessControl.RegistryRights.FullControl); if (rGPOLocalMachineKey == null) { diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index a0056fd4f93..96d87e0a8b7 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -33,7 +33,6 @@ - diff --git a/src/System.Management.Automation/engine/CodeMethods.cs b/src/System.Management.Automation/engine/CodeMethods.cs index eebdc5a7138..f27d94ca9ef 100644 --- a/src/System.Management.Automation/engine/CodeMethods.cs +++ b/src/System.Management.Automation/engine/CodeMethods.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#if !UNIX using System; using System.Collections; using System.Reflection; @@ -130,3 +131,4 @@ public static string ConvertDNWithBinaryToString(PSObject deInstance, PSObject d #endregion } } +#endif diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index f282968c7a8..09ffe8e1a6c 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -3720,14 +3720,6 @@ internal PSSnapInInfo ImportPSSnapIn(PSSnapInInfo psSnapInInfo, out PSSnapInExce throw e; } -#if !CORECLR // CustomPSSnapIn Not Supported On CSS. - if (!String.IsNullOrEmpty(psSnapInInfo.CustomPSSnapInType)) - { - LoadCustomPSSnapIn(psSnapInInfo); - warning = null; - return psSnapInInfo; - } -#endif Assembly assembly = null; string helpFile = null; @@ -3875,137 +3867,6 @@ internal List GetPSSnapIn(string psSnapinName) return loadedSnapins; } -#if !CORECLR // CustomPSSnapIn Not Supported On CSS. - /// - /// This is a "proxy" snapin that loads a subset of cmdlets from another snapin... - /// - /// - /// CustomPSSnapIn derives from System.Configuration.Install, which is not in CoreCLR. - /// So CustomPSSnapIn is not supported on CSS. - /// - /// The snapin to examine. - private void LoadCustomPSSnapIn(PSSnapInInfo psSnapInInfo) - { - if (psSnapInInfo == null) - return; - - if (String.IsNullOrEmpty(psSnapInInfo.CustomPSSnapInType)) - { - return; - } - - Dictionary cmdlets = null; - Dictionary providers = null; - Assembly assembly = null; - - s_PSSnapInTracer.WriteLine("Loading assembly for mshsnapin {0}", psSnapInInfo.Name); - - assembly = PSSnapInHelpers.LoadPSSnapInAssembly(psSnapInInfo, out cmdlets, out providers); - - if (assembly == null) - { - s_PSSnapInTracer.TraceError("Loading assembly for mshsnapin {0} failed", psSnapInInfo.Name); - return; - } - - CustomPSSnapIn customPSSnapIn = null; - try - { - Type type = assembly.GetType(psSnapInInfo.CustomPSSnapInType, true); - - if (type != null) - { - customPSSnapIn = (CustomPSSnapIn)assembly.CreateInstance(psSnapInInfo.CustomPSSnapInType); - } - - s_PSSnapInTracer.WriteLine("Loading assembly for mshsnapin {0} succeeded", psSnapInInfo.Name); - } - catch (TypeLoadException tle) - { - throw new PSSnapInException(psSnapInInfo.Name, tle.Message); - } - catch (ArgumentException ae) - { - throw new PSSnapInException(psSnapInInfo.Name, ae.Message); - } - catch (MissingMethodException mme) - { - throw new PSSnapInException(psSnapInInfo.Name, mme.Message); - } - catch (InvalidCastException ice) - { - throw new PSSnapInException(psSnapInInfo.Name, ice.Message); - } - catch (TargetInvocationException tie) - { - if (tie.InnerException != null) - { - throw new PSSnapInException(psSnapInInfo.Name, tie.InnerException.Message); - } - - throw new PSSnapInException(psSnapInInfo.Name, tie.Message); - } - - MergeCustomPSSnapIn(psSnapInInfo, customPSSnapIn); - } - - private void MergeCustomPSSnapIn(PSSnapInInfo psSnapInInfo, CustomPSSnapIn customPSSnapIn) - { - if (psSnapInInfo == null || customPSSnapIn == null) - return; - - s_PSSnapInTracer.WriteLine("Merging configuration from custom mshsnapin {0}", psSnapInInfo.Name); - - if (customPSSnapIn.Cmdlets != null) - { - foreach (CmdletConfigurationEntry entry in customPSSnapIn.Cmdlets) - { - SessionStateCmdletEntry cmdlet = new SessionStateCmdletEntry(entry.Name, entry.ImplementingType, entry.HelpFileName); - cmdlet.SetPSSnapIn(psSnapInInfo); - this.Commands.Add(cmdlet); - } - } - - if (customPSSnapIn.Providers != null) - { - foreach (ProviderConfigurationEntry entry in customPSSnapIn.Providers) - { - SessionStateProviderEntry provider = new SessionStateProviderEntry(entry.Name, entry.ImplementingType, entry.HelpFileName); - provider.SetPSSnapIn(psSnapInInfo); - this.Providers.Add(provider); - } - } - - if (customPSSnapIn.Types != null) - { - foreach (TypeConfigurationEntry entry in customPSSnapIn.Types) - { - string path = Path.Combine(psSnapInInfo.ApplicationBase, entry.FileName); - - SessionStateTypeEntry typeEntry = new SessionStateTypeEntry(path); - typeEntry.SetPSSnapIn(psSnapInInfo); - this.Types.Add(typeEntry); - } - } - - if (customPSSnapIn.Formats != null) - { - foreach (FormatConfigurationEntry entry in customPSSnapIn.Formats) - { - string path = Path.Combine(psSnapInInfo.ApplicationBase, entry.FileName); - - SessionStateFormatEntry formatEntry = new SessionStateFormatEntry(path); - formatEntry.SetPSSnapIn(psSnapInInfo); - this.Formats.Add(formatEntry); - } - } - - SessionStateAssemblyEntry assemblyEntry = new SessionStateAssemblyEntry(psSnapInInfo.AssemblyName, psSnapInInfo.AbsoluteModulePath); - - this.Assemblies.Add(assemblyEntry); - } -#endif - [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom")] internal static Assembly LoadAssemblyFromFile(string fileName) { diff --git a/src/System.Management.Automation/engine/Types_Ps1Xml.cs b/src/System.Management.Automation/engine/Types_Ps1Xml.cs index 12dfc6ec70e..baa6499c7b6 100644 --- a/src/System.Management.Automation/engine/Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/Types_Ps1Xml.cs @@ -54,12 +54,12 @@ public static IEnumerable Get() }"), null)); yield return td4; -#if !CORECLR +#if !UNIX var td5 = new TypeData(@"System.DirectoryServices.PropertyValueCollection", true); td5.Members.Add("ToString", new CodeMethodData("ToString", GetMethodInfo(typeof(Microsoft.PowerShell.ToStringCodeMethods), @"PropertyValueCollection"))); yield return td5; -#endif // !CORECLR +#endif var td6 = new TypeData(@"System.Drawing.Printing.PrintDocument", true); td6.Members.Add("Name", @@ -169,7 +169,7 @@ public static IEnumerable Get() }"), null)); yield return td17; -#if !CORECLR +#if !UNIX var td18 = new TypeData(@"System.DirectoryServices.DirectoryEntry", true); td18.Members.Add("ConvertLargeIntegerToInt64", new CodeMethodData("ConvertLargeIntegerToInt64", GetMethodInfo(typeof(Microsoft.PowerShell.AdapterCodeMethods), @"ConvertLargeIntegerToInt64"))); @@ -178,7 +178,7 @@ public static IEnumerable Get() td18.DefaultDisplayPropertySet = new PropertySetData(new [] { "distinguishedName", "Path" }) { Name = "DefaultDisplayPropertySet" }; yield return td18; -#endif // !CORECLR +#endif var td19 = new TypeData(@"System.IO.DirectoryInfo", true); td19.Members.Add("Mode", diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index c926110ac47..67871d5da9b 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -1443,13 +1443,7 @@ internal void OnSequencePointHit(FunctionContext functionContext) _currentDebuggerAction = DebuggerResumeAction.Continue; ResumeExecution(DebuggerResumeAction.Stop); } -#if !CORECLR // Workflow Not Supported on OneCore PS - // Lazily subscribe to workflow start engine event for workflow debugging. - if (!_wfStartEventSubscribed && IsJobDebuggingMode()) - { - SubscribeToEngineWFJobStartEvent(); - } -#endif + UpdateBreakpoints(functionContext); if (_steppingMode == SteppingMode.StepIn && @@ -1631,9 +1625,6 @@ internal void Clear() private PowerShell _psDebuggerCommand; // Job debugger integration. -#if !CORECLR // Workflow Not Supported on OneCore PS - private bool _wfStartEventSubscribed; -#endif private bool _nestedDebuggerStop; private bool _writeWFErrorOnce; private Dictionary _runningJobs; @@ -2098,14 +2089,7 @@ private void EnableDebuggerStepping(EnableNestedType nestedType) ResumeExecution(DebuggerResumeAction.StepInto); } } -#if !CORECLR - // Workflow Not Supported on OneCore PS - // Look for any running workflow jobs and set to step mode. - if ((nestedType & EnableNestedType.NestedJob) == EnableNestedType.NestedJob) - { - EnableRunningWorkflowJobsForStepping(); - } -#endif + // Look for any runspaces with debuggers and set to setp mode. if ((nestedType & EnableNestedType.NestedRunspace) == EnableNestedType.NestedRunspace) { @@ -2813,62 +2797,6 @@ private void RunspaceAvailabilityChangedHandler(object sender, RunspaceAvailabil #region Job debugger integration -#if !CORECLR // Workflow Not Supported on OneCore PS - private void SubscribeToEngineWFJobStartEvent() - { - Diagnostics.Assert(_context.Events != null, "Event manager cannot be null."); - - _context.Events.SubscribeEvent( - source: null, - eventName: null, - sourceIdentifier: PSEngineEvent.WorkflowJobStartEvent, - data: null, - handlerDelegate: HandleJobStartEvent, - supportEvent: true, - forwardEvent: false); - - _wfStartEventSubscribed = true; - } - - private void UnsubscribeFromEngineWFJobStartEvent() - { - PSEventManager eventManager = _context.Events; - Diagnostics.Assert(eventManager != null, "Event manager cannot be null."); - - foreach (var subscriber in eventManager.GetEventSubscribers(PSEngineEvent.WorkflowJobStartEvent)) - { - eventManager.UnsubscribeEvent(subscriber); - } - - _wfStartEventSubscribed = false; - } - - private void HandleJobStartEvent(object sender, PSEventArgs args) - { - Diagnostics.Assert(args.SourceArgs.Length == 1, "WF Job Started engine event SourceArgs should have a single element."); - PSJobStartEventArgs jobStartedArgs = args.SourceArgs[0] as PSJobStartEventArgs; - Diagnostics.Assert(jobStartedArgs != null, "WF Job Started engine event args cannot be null."); - Diagnostics.Assert(jobStartedArgs.Job != null, "WF Job to start cannot be null."); - Diagnostics.Assert(jobStartedArgs.Debugger != null, "WF Job Started Debugger object cannot be null."); - - if (!(jobStartedArgs.Debugger.GetType().FullName.Equals("Microsoft.PowerShell.Workflow.PSWorkflowDebugger", - StringComparison.OrdinalIgnoreCase))) - { - // Check to ensure only PS workflow debuggers can be passed in. - throw new PSInvalidOperationException(); - } - - // At this point the script debugger stack frame must be the Workflow execution function which is DebuggerHidden. - // The internal debugger resume action is set to StepOut, *if* the user selected StepIn, so as to skip this frame - // since debugging the workflow execution function is turned off. We look at the previous resume action to see - // what the user intended. If it is StepIn then we start the workflow job debugger in step mode. - Diagnostics.Assert(_callStack.LastFunctionContext()._debuggerHidden, "Current stack frame must be WF function DebuggerHidden"); - DebuggerResumeAction startAction = (_previousDebuggerAction == DebuggerResumeAction.StepInto) ? - DebuggerResumeAction.StepInto : DebuggerResumeAction.Continue; - AddToJobRunningList(jobStartedArgs, startAction); - } -#endif - private void AddToJobRunningList(PSJobStartEventArgs jobArgs, DebuggerResumeAction startAction) { bool newJob = false; @@ -2993,9 +2921,6 @@ private void RemoveFromRunningJobList(Job job) private void ClearRunningJobList() { -#if !CORECLR // Workflow Not Supported on OneCore PS - UnsubscribeFromEngineWFJobStartEvent(); -#endif PSJobStartEventArgs[] runningJobs = null; lock (_syncObject) { @@ -3148,12 +3073,6 @@ private void HandleMonitorRunningJobsDebuggerStop(object sender, DebuggerStopEve { if (!IsJobDebuggingMode()) { -#if !CORECLR // Workflow Not Supported on OneCore PS - // Remove workflow job callback. - UnsubscribeFromEngineWFJobStartEvent(); - // Write warning to user. - WriteWorkflowDebugNotSupportedError(); -#endif // Ignore job debugger stop. args.ResumeAction = DebuggerResumeAction.Continue; return; @@ -3357,57 +3276,6 @@ private void WriteWorkflowDebugNotSupportedError() } } -#if !CORECLR // Workflow Not Supported on OneCore PS - private void EnableRunningWorkflowJobsForStepping() - { - // Make sure workflow job start callback is set to pick - // up any newly starting jobs. - if (!_wfStartEventSubscribed) - { - lock (_syncObject) - { - if (!_wfStartEventSubscribed) - { - SubscribeToEngineWFJobStartEvent(); - } - } - } - - // Get list of workflow jobs - Collection jobs; - using (PowerShell ps = PowerShell.Create()) - { - ps.Commands.Clear(); - ps.AddScript(@"Get-Job | Where-Object {$_.PSJobTypeName -eq 'PSWorkflowJob'}"); - jobs = ps.Invoke(); - } - - // Add debuggable workflow jobs to running Job list - // and set debugger to step mode. - foreach (var parentJob in jobs) - { - if (parentJob != null) - { - foreach (var childJob in parentJob.ChildJobs) - { - IJobDebugger debuggableJob = childJob as IJobDebugger; - if (debuggableJob != null) - { - AddToJobRunningList( - new PSJobStartEventArgs( - childJob, - debuggableJob.Debugger, - debuggableJob.IsAsync), - DebuggerResumeAction.StepInto); - } - } - } - } - - // Ensure existing running jobs in list are also set to step mode. - SetRunningJobListToStep(true); - } -#endif #endregion #region Runspace debugger integration @@ -3845,9 +3713,6 @@ private void WaitForDebugComplete() /// public void Dispose() { -#if !CORECLR // Workflow Not Supported on OneCore PS - UnsubscribeFromEngineWFJobStartEvent(); -#endif // Ensure all job event handlers are removed. PSJobStartEventArgs[] runningJobs; lock (_syncObject) diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHost.cs b/src/System.Management.Automation/engine/hostifaces/InternalHost.cs index 8615cb40f68..50ae88a8c84 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHost.cs @@ -299,7 +299,6 @@ internal void EnterNestedPrompt(InternalCommand callingCommand) commandInfoProperty.Value = callingCommand.CommandInfo; } -#if !CORECLR //TODO:CORECLR StackTrace not in CoreCLR stackTraceProperty = newValue.Properties["StackTrace"]; if (stackTraceProperty == null) { @@ -310,7 +309,6 @@ internal void EnterNestedPrompt(InternalCommand callingCommand) oldStackTrace = stackTraceProperty.Value; stackTraceProperty.Value = new System.Diagnostics.StackTrace(); } -#endif Context.SetVariable(SpecialVariables.CurrentlyExecutingCommandVarPath, newValue); } diff --git a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs index 7839f772916..5651af92981 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs @@ -1520,9 +1520,7 @@ internal static System.Byte[] ExtractEncodedXmlElement(String xmlBuffer, String readerSettings.CheckCharacters = false; readerSettings.IgnoreComments = true; readerSettings.IgnoreProcessingInstructions = true; -#if !CORECLR // No XmlReaderSettings.XmlResolver in CoreCLR readerSettings.XmlResolver = null; -#endif readerSettings.ConformanceLevel = ConformanceLevel.Fragment; readerSettings.MaxCharactersFromEntities = 1024; readerSettings.DtdProcessing = System.Xml.DtdProcessing.Prohibit; diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 8267c5e7a7f..b502fe5e910 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -7594,26 +7594,6 @@ private static extern bool DeviceIoControl(IntPtr hDevice, uint dwIoControlCode, IntPtr OutBuffer, int nOutBufferSize, out int pBytesReturned, IntPtr lpOverlapped); -#if !CORECLR - - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - private static extern IntPtr FindFirstFileName( - string lpFileName, - uint flags, - ref UInt32 StringLength, - StringBuilder LinkName); - - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - private static extern bool FindNextFileName( - IntPtr hFindStream, - ref UInt32 StringLength, - StringBuilder LinkName); - - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - private static extern bool FindClose(IntPtr hFindFile); - -#endif - [DllImport(PinvokeDllNames.GetFileInformationByHandleDllName, SetLastError = true, CharSet = CharSet.Unicode)] private static extern bool GetFileInformationByHandle( IntPtr hFile,