// Decompiled with JetBrains decompiler // Type: Microsoft.InfoCards.RequestFactory // Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // MVID: ADE0A079-11DB-4A46-8BDE-D2A592CA8DEA // Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-67b630ead60119692b9abbdfd8717c96904ef041127c2cae033c86b718eaa61e.exe using Microsoft.InfoCards.Diagnostics; using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Security.Principal; using System.Text; namespace Microsoft.InfoCards { internal class RequestFactory { private const int MaxRequestBlobSize = 20971520; private static readonly RequestFactory.RequestName[] s_uiClientRequests = new RequestFactory.RequestName[4] { RequestFactory.RequestName.GetBrowserTokenRequest, RequestFactory.RequestName.GetTokenRequest, RequestFactory.RequestName.ImportRequest, RequestFactory.RequestName.ManageRequest }; private static object s_createRequestSync = new object(); private static Dictionary s_requestMap = new Dictionary(54); private RequestFactory() { } static RequestFactory() { RequestFactory.s_requestMap["CloseCryptoHandleRequest"] = RequestFactory.RequestName.CloseCryptoHandleRequest; RequestFactory.s_requestMap["DecryptRequest"] = RequestFactory.RequestName.DecryptRequest; RequestFactory.s_requestMap["EncryptRequest"] = RequestFactory.RequestName.EncryptRequest; RequestFactory.s_requestMap["GenerateDerivedKeyRequest"] = RequestFactory.RequestName.GenerateDerivedKeyRequest; RequestFactory.s_requestMap["GetBrowserTokenRequest"] = RequestFactory.RequestName.GetBrowserTokenRequest; RequestFactory.s_requestMap["GetCryptoTransformRequest"] = RequestFactory.RequestName.GetCryptoTransformRequest; RequestFactory.s_requestMap["GetKeyedHashRequest"] = RequestFactory.RequestName.GetKeyedHashRequest; RequestFactory.s_requestMap["GetTokenRequest"] = RequestFactory.RequestName.GetTokenRequest; RequestFactory.s_requestMap["HashCoreRequest"] = RequestFactory.RequestName.HashCoreRequest; RequestFactory.s_requestMap["HashFinalRequest"] = RequestFactory.RequestName.HashFinalRequest; RequestFactory.s_requestMap["ImportRequest"] = RequestFactory.RequestName.ImportRequest; RequestFactory.s_requestMap["ManageRequest"] = RequestFactory.RequestName.ManageRequest; RequestFactory.s_requestMap["SignHashRequest"] = RequestFactory.RequestName.SignHashRequest; RequestFactory.s_requestMap["TransformBlockRequest"] = RequestFactory.RequestName.TransformBlockRequest; RequestFactory.s_requestMap["TransformFinalBlockRequest"] = RequestFactory.RequestName.TransformFinalBlockRequest; RequestFactory.s_requestMap["VerifyHashRequest"] = RequestFactory.RequestName.VerifyHashRequest; RequestFactory.s_requestMap["BeginCreateSecurityTokenRequest"] = RequestFactory.RequestName.BeginCreateSecurityTokenRequest; RequestFactory.s_requestMap["BeginSelectCardRequest"] = RequestFactory.RequestName.BeginSelectCardRequest; RequestFactory.s_requestMap["CancelAsyncOperationRequest"] = RequestFactory.RequestName.CancelAsyncOperationRequest; RequestFactory.s_requestMap["CheckStoreFileValidityRequest"] = RequestFactory.RequestName.CheckStoreFileValidityRequest; RequestFactory.s_requestMap["CreateCardRequest"] = RequestFactory.RequestName.CreateCardRequest; RequestFactory.s_requestMap["DeleteCardRequest"] = RequestFactory.RequestName.DeleteCardRequest; RequestFactory.s_requestMap["DeleteStoreRequest"] = RequestFactory.RequestName.DeleteStoreRequest; RequestFactory.s_requestMap["EndCreateSecurityTokenRequest"] = RequestFactory.RequestName.EndCreateSecurityTokenRequest; RequestFactory.s_requestMap["EndSelectCardRequest"] = RequestFactory.RequestName.EndSelectCardRequest; RequestFactory.s_requestMap["ExportFileRequest"] = RequestFactory.RequestName.ExportFileRequest; RequestFactory.s_requestMap["GetCertificateRequest"] = RequestFactory.RequestName.GetCertificateRequest; RequestFactory.s_requestMap["GetImportedCardRequest"] = RequestFactory.RequestName.GetImportedCardRequest; RequestFactory.s_requestMap["GetImportFileNameRequest"] = RequestFactory.RequestName.GetImportFileNameRequest; RequestFactory.s_requestMap["GetLedgerEntryForRecipientRequest"] = RequestFactory.RequestName.GetLedgerEntryForRecipientRequest; RequestFactory.s_requestMap["GetLedgerRequest"] = RequestFactory.RequestName.GetLedgerRequest; RequestFactory.s_requestMap["GetPolicyDetailsRequest"] = RequestFactory.RequestName.GetPolicyDetailsRequest; RequestFactory.s_requestMap["GetRecipientListRequest"] = RequestFactory.RequestName.GetRecipientListRequest; RequestFactory.s_requestMap["GetRecipientRequest"] = RequestFactory.RequestName.GetRecipientRequest; RequestFactory.s_requestMap["GetUserPreferenceRequest"] = RequestFactory.RequestName.GetUserPreferenceRequest; RequestFactory.s_requestMap["ImportFileRequest"] = RequestFactory.RequestName.ImportFileRequest; RequestFactory.s_requestMap["InfoCardListRequest"] = RequestFactory.RequestName.InfoCardListRequest; RequestFactory.s_requestMap["ListCardsInFileRequest"] = RequestFactory.RequestName.ListCardsInFileRequest; RequestFactory.s_requestMap["QueryStoreStatusRequest"] = RequestFactory.RequestName.QueryStoreStatusRequest; RequestFactory.s_requestMap["ResolvePPIDRequest"] = RequestFactory.RequestName.ResolvePPIDRequest; RequestFactory.s_requestMap["SaveCardRequest"] = RequestFactory.RequestName.SaveCardRequest; RequestFactory.s_requestMap["SaveLedgerEntryRequest"] = RequestFactory.RequestName.SaveLedgerEntryRequest; RequestFactory.s_requestMap["SaveRecipientRequest"] = RequestFactory.RequestName.SaveRecipientRequest; RequestFactory.s_requestMap["SendAgentStatusRequest"] = RequestFactory.RequestName.SendAgentStatusRequest; RequestFactory.s_requestMap["SetUserPreferenceRequest"] = RequestFactory.RequestName.SetUserPreferenceRequest; RequestFactory.s_requestMap["BeginGetFileNameFromUserRequest"] = RequestFactory.RequestName.BeginGetFileNameFromUserRequest; RequestFactory.s_requestMap["EndGetFileNameFromUserRequest"] = RequestFactory.RequestName.EndGetFileNameFromUserRequest; RequestFactory.s_requestMap["UIEndRequest"] = RequestFactory.RequestName.UIEndRequest; RequestFactory.s_requestMap["ListDependantCardsRequest"] = RequestFactory.RequestName.ListDependantCardsRequest; RequestFactory.s_requestMap["GetLastErrorDetailsRequest"] = RequestFactory.RequestName.GetLastErrorDetailsRequest; RequestFactory.s_requestMap["GetIsBrowserClientRequest"] = RequestFactory.RequestName.GetIsBrowserClientRequest; RequestFactory.s_requestMap["SetUserLanguageRequest"] = RequestFactory.RequestName.SetUserLanguageRequest; RequestFactory.s_requestMap["GetCardDetailsRequest"] = RequestFactory.RequestName.GetCardDetailsRequest; RequestFactory.s_requestMap["UnlockCardRequest"] = RequestFactory.RequestName.UnlockCardRequest; } internal static int ProcessNewRequest( int parentRequestHandle, IntPtr rpcHandle, IntPtr inArgs, out IntPtr outArgs) { InfoCardTrace.Assert(null == WindowsIdentity.GetCurrent(true), "unexpected user context on incoming thread"); int num = 0; outArgs = IntPtr.Zero; if (IntPtr.Zero == inArgs) return -1073413888; if (IntPtr.Zero == rpcHandle) return -1073413888; try { RpcRequest structure = (RpcRequest) Marshal.PtrToStructure(inArgs, typeof (RpcRequest)); if (structure.Length < 0 || structure.Length > 20971520 || structure.Type == null || structure.Length > 0 && IntPtr.Zero == structure.Data) return -1073413888; Stream inStream; if (structure.Length != 0) { byte[] numArray = new byte[structure.Length]; Marshal.Copy(structure.Data, numArray, 0, structure.Length); inStream = (Stream) new MemoryStream(numArray, 0, numArray.Length, false, false); } else inStream = (Stream) new MemoryStream(); MemoryStream memoryStream = new MemoryStream(); if (parentRequestHandle == 0) { using (UIAgentMonitorHandle monitorHandle = new UIAgentMonitorHandle()) { using (ClientRequest clientRequestInstance = RequestFactory.CreateClientRequestInstance(monitorHandle, structure.Type, rpcHandle, inStream, (Stream) memoryStream)) { num = clientRequestInstance.DoProcessRequest(out string _); RpcResponse outArgs1; RequestFactory.ConvertStreamToIntPtr(memoryStream, out outArgs1); outArgs = outArgs1.Marshal(); } } } else { ClientUIRequest requestByHandle = (ClientUIRequest) Request.FindRequestByHandle(parentRequestHandle); InfoCardTrace.Assert(null != requestByHandle, "ParentRequest is null"); using (UIAgentRequest agentRequestInstance = RequestFactory.CreateUIAgentRequestInstance(requestByHandle, structure.Type, rpcHandle, inStream, (Stream) memoryStream)) { string extendedMessage; num = agentRequestInstance.DoProcessRequest(out extendedMessage); if (num != 0) Utility.SerializeString(new BinaryWriter((Stream) memoryStream, Encoding.Unicode), extendedMessage); RpcResponse outArgs2; RequestFactory.ConvertStreamToIntPtr(memoryStream, out outArgs2); outArgs = outArgs2.Marshal(); } } } catch (TargetInvocationException ex) { if (ex.InnerException != null && ex.InnerException is InfoCardBaseException) num = ((InfoCardBaseException) ex.InnerException).NativeHResult; else InfoCardService.Crash((Exception) ex); } catch (InfoCardBaseException ex) { num = ex.NativeHResult; } catch (OutOfMemoryException ex) { num = -2147024882; } catch (EndOfStreamException ex) { num = -1073413863; } catch (Exception ex) { InfoCardTrace.TraceAndLogException(ex); InfoCardService.Crash(ex); } return num; } private static void ConvertStreamToIntPtr(MemoryStream outStream, out RpcResponse outArgs) { byte[] buffer = outStream.GetBuffer(); outArgs = new RpcResponse(); outArgs.Length = 0; outArgs.Data = IntPtr.Zero; if (buffer == null || buffer.Length == 0) return; IntPtr destination = Marshal.AllocHGlobal(buffer.Length); Marshal.Copy(buffer, 0, destination, buffer.Length); outArgs.Data = destination; outArgs.Length = buffer.Length; } private static ClientRequest CreateClientRequestInstance( UIAgentMonitorHandle monitorHandle, string reqName, IntPtr rpcHandle, Stream inStream, Stream outStream) { ClientRequest clientRequestInstance = (ClientRequest) null; lock (RequestFactory.s_createRequestSync) { if (string.IsNullOrEmpty(reqName)) throw InfoCardTrace.ThrowHelperError((Exception) new CommunicationException()); RequestFactory.RequestName requestName = RequestFactory.s_requestMap.ContainsKey(reqName) ? RequestFactory.s_requestMap[reqName] : throw InfoCardTrace.ThrowHelperError((Exception) new CommunicationException()); if (-1 != Array.IndexOf(RequestFactory.s_uiClientRequests, requestName)) { Process contextMapping = ClientUIRequest.GetContextMapping(rpcHandle, true); InfoCardTrace.ThrowInvalidArgumentConditional(null == contextMapping, nameof (rpcHandle)); int tSSession = 0; if (!NativeMethods.ProcessIdToSessionId(contextMapping.Id, out tSSession)) { int lastWin32Error = Marshal.GetLastWin32Error(); throw InfoCardTrace.ThrowHelperError((Exception) new CommunicationException(SR.GetString("ServiceErrorGettingClientTSSession"), (Exception) new Win32Exception(lastWin32Error))); } WindowsIdentity executionIdentity = NativeMcppMethods.CreateServiceExecutionIdentity(contextMapping); InfoCardUIAgent agent = monitorHandle.CreateAgent(contextMapping.Id, executionIdentity, tSSession); switch (RequestFactory.s_requestMap[reqName]) { case RequestFactory.RequestName.GetBrowserTokenRequest: clientRequestInstance = (ClientRequest) new GetBrowserTokenRequest(contextMapping, executionIdentity, agent, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.GetTokenRequest: clientRequestInstance = (ClientRequest) new GetTokenRequest(contextMapping, executionIdentity, agent, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.ImportRequest: clientRequestInstance = (ClientRequest) new ImportRequest(contextMapping, executionIdentity, agent, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.ManageRequest: clientRequestInstance = (ClientRequest) new ManageRequest(contextMapping, executionIdentity, agent, rpcHandle, inStream, outStream); break; default: throw InfoCardTrace.ThrowHelperError((Exception) new CommunicationException()); } } else { Process processFromRpcHandle = ClientRequest.GetCallingProcessFromRpcHandle(rpcHandle); WindowsIdentity executionIdentity = NativeMcppMethods.CreateServiceExecutionIdentity(processFromRpcHandle); switch (RequestFactory.s_requestMap[reqName]) { case RequestFactory.RequestName.CloseCryptoHandleRequest: clientRequestInstance = (ClientRequest) new CloseCryptoHandleRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.DecryptRequest: clientRequestInstance = (ClientRequest) new DecryptRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.EncryptRequest: clientRequestInstance = (ClientRequest) new EncryptRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.GenerateDerivedKeyRequest: clientRequestInstance = (ClientRequest) new GenerateDerivedKeyRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.GetCryptoTransformRequest: clientRequestInstance = (ClientRequest) new GetCryptoTransformRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.GetKeyedHashRequest: clientRequestInstance = (ClientRequest) new GetKeyedHashRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.HashCoreRequest: clientRequestInstance = (ClientRequest) new HashCoreRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.HashFinalRequest: clientRequestInstance = (ClientRequest) new HashFinalRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.SignHashRequest: clientRequestInstance = (ClientRequest) new SignHashRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.TransformBlockRequest: clientRequestInstance = (ClientRequest) new TransformBlockRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.TransformFinalBlockRequest: clientRequestInstance = (ClientRequest) new TransformFinalBlockRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; case RequestFactory.RequestName.VerifyHashRequest: clientRequestInstance = (ClientRequest) new VerifyHashRequest(processFromRpcHandle, executionIdentity, rpcHandle, inStream, outStream); break; default: throw InfoCardTrace.ThrowHelperError((Exception) new CommunicationException()); } } clientRequestInstance.Initialize(); } return clientRequestInstance; } private static UIAgentRequest CreateUIAgentRequestInstance( ClientUIRequest parentRequest, string reqName, IntPtr rpcHandle, Stream inStream, Stream outStream) { UIAgentRequest agentRequestInstance = (UIAgentRequest) null; lock (RequestFactory.s_createRequestSync) { InfoCardTrace.Assert(!string.IsNullOrEmpty(reqName), "Null or empty request name"); InfoCardTrace.Assert(RequestFactory.s_requestMap.ContainsKey(reqName), "Request map does not contain " + reqName); switch (RequestFactory.s_requestMap[reqName]) { case RequestFactory.RequestName.BeginCreateSecurityTokenRequest: agentRequestInstance = (UIAgentRequest) new BeginCreateSecurityTokenRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.BeginSelectCardRequest: agentRequestInstance = (UIAgentRequest) new BeginSelectCardRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.CancelAsyncOperationRequest: agentRequestInstance = (UIAgentRequest) new CancelAsyncOperationRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.CreateCardRequest: agentRequestInstance = (UIAgentRequest) new CreateCardRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.CheckStoreFileValidityRequest: agentRequestInstance = (UIAgentRequest) new CheckStoreFileValidityRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.DeleteCardRequest: agentRequestInstance = (UIAgentRequest) new DeleteCardRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.DeleteStoreRequest: agentRequestInstance = (UIAgentRequest) new DeleteStoreRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.EndCreateSecurityTokenRequest: agentRequestInstance = (UIAgentRequest) new EndCreateSecurityTokenRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.EndSelectCardRequest: agentRequestInstance = (UIAgentRequest) new EndSelectCardRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.ExportFileRequest: agentRequestInstance = (UIAgentRequest) new ExportFileRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetCertificateRequest: agentRequestInstance = (UIAgentRequest) new GetCertificateRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetImportedCardRequest: agentRequestInstance = (UIAgentRequest) new GetImportedCardRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetImportFileNameRequest: agentRequestInstance = (UIAgentRequest) new GetImportFileNameRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetLedgerEntryForRecipientRequest: agentRequestInstance = (UIAgentRequest) new GetLedgerEntryForRecipientRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetLedgerRequest: agentRequestInstance = (UIAgentRequest) new GetLedgerRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetPolicyDetailsRequest: agentRequestInstance = (UIAgentRequest) new GetPolicyDetailsRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetRecipientListRequest: agentRequestInstance = (UIAgentRequest) new GetRecipientListRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetRecipientRequest: agentRequestInstance = (UIAgentRequest) new GetRecipientRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetUserPreferenceRequest: agentRequestInstance = (UIAgentRequest) new GetUserPreferenceRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.ImportFileRequest: agentRequestInstance = (UIAgentRequest) new ImportFileRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.InfoCardListRequest: agentRequestInstance = (UIAgentRequest) new InfoCardListRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.ListCardsInFileRequest: agentRequestInstance = (UIAgentRequest) new ListCardsInFileRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.QueryStoreStatusRequest: agentRequestInstance = (UIAgentRequest) new QueryStoreStatusRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.ResolvePPIDRequest: agentRequestInstance = (UIAgentRequest) new ResolvePPIDRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.SaveCardRequest: agentRequestInstance = (UIAgentRequest) new SaveCardRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.SaveLedgerEntryRequest: agentRequestInstance = (UIAgentRequest) new SaveLedgerEntryRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.SaveRecipientRequest: agentRequestInstance = (UIAgentRequest) new SaveRecipientRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.SendAgentStatusRequest: agentRequestInstance = (UIAgentRequest) new SendAgentStatusRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.SetUserPreferenceRequest: agentRequestInstance = (UIAgentRequest) new SetUserPreferenceRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.UIEndRequest: agentRequestInstance = (UIAgentRequest) new UIEndRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.BeginGetFileNameFromUserRequest: agentRequestInstance = (UIAgentRequest) new BeginGetFileNameFromUserRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.EndGetFileNameFromUserRequest: agentRequestInstance = (UIAgentRequest) new EndGetFileNameFromUserRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.ListDependantCardsRequest: agentRequestInstance = (UIAgentRequest) new ListDependantCardsRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetLastErrorDetailsRequest: agentRequestInstance = (UIAgentRequest) new GetLastErrorDetailsRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetIsBrowserClientRequest: agentRequestInstance = (UIAgentRequest) new GetIsBrowserClientRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.SetUserLanguageRequest: agentRequestInstance = (UIAgentRequest) new SetUserLanguageRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.GetCardDetailsRequest: agentRequestInstance = (UIAgentRequest) new GetCardDetailsRequest(rpcHandle, inStream, outStream, parentRequest); break; case RequestFactory.RequestName.UnlockCardRequest: agentRequestInstance = (UIAgentRequest) new UnlockCardRequest(rpcHandle, inStream, outStream, parentRequest); break; default: throw InfoCardTrace.ThrowHelperError((Exception) new CommunicationException()); } agentRequestInstance.Initialize(); } return agentRequestInstance; } private enum RequestName { CloseCryptoHandleRequest = 0, DecryptRequest = 1, EncryptRequest = 2, GenerateDerivedKeyRequest = 3, GetBrowserTokenRequest = 4, GetCryptoTransformRequest = 5, GetKeyedHashRequest = 6, GetTokenRequest = 7, HashCoreRequest = 8, HashFinalRequest = 9, ImportRequest = 10, // 0x0000000A ManageRequest = 11, // 0x0000000B SignHashRequest = 12, // 0x0000000C TransformBlockRequest = 13, // 0x0000000D TransformFinalBlockRequest = 14, // 0x0000000E VerifyHashRequest = 15, // 0x0000000F ClientRequestCount = 16, // 0x00000010 AgentRequestCount = 38, // 0x00000026 BeginCreateSecurityTokenRequest = 128, // 0x00000080 BeginSelectCardRequest = 129, // 0x00000081 CancelAsyncOperationRequest = 130, // 0x00000082 CreateCardRequest = 131, // 0x00000083 CheckStoreFileValidityRequest = 132, // 0x00000084 DeleteCardRequest = 133, // 0x00000085 DeleteStoreRequest = 134, // 0x00000086 EndCreateSecurityTokenRequest = 135, // 0x00000087 EndSelectCardRequest = 136, // 0x00000088 ExportFileRequest = 137, // 0x00000089 GetCertificateRequest = 138, // 0x0000008A GetImportedCardRequest = 139, // 0x0000008B GetImportFileNameRequest = 140, // 0x0000008C GetLedgerEntryForRecipientRequest = 141, // 0x0000008D GetLedgerRequest = 142, // 0x0000008E GetPolicyDetailsRequest = 143, // 0x0000008F GetRecipientListRequest = 144, // 0x00000090 GetRecipientRequest = 145, // 0x00000091 GetUserPreferenceRequest = 146, // 0x00000092 ImportFileRequest = 147, // 0x00000093 InfoCardListRequest = 148, // 0x00000094 ListCardsInFileRequest = 149, // 0x00000095 QueryStoreStatusRequest = 150, // 0x00000096 ResolvePPIDRequest = 151, // 0x00000097 SaveCardRequest = 152, // 0x00000098 SaveLedgerEntryRequest = 153, // 0x00000099 SaveRecipientRequest = 154, // 0x0000009A SendAgentStatusRequest = 155, // 0x0000009B SetUserPreferenceRequest = 156, // 0x0000009C UIEndRequest = 157, // 0x0000009D BeginGetFileNameFromUserRequest = 158, // 0x0000009E EndGetFileNameFromUserRequest = 159, // 0x0000009F ListDependantCardsRequest = 160, // 0x000000A0 GetLastErrorDetailsRequest = 161, // 0x000000A1 GetIsBrowserClientRequest = 162, // 0x000000A2 SetUserLanguageRequest = 163, // 0x000000A3 GetCardDetailsRequest = 164, // 0x000000A4 UnlockCardRequest = 165, // 0x000000A5 } } }