コード例 #1
0
        // Token: 0x0600014D RID: 333 RVA: 0x00004E00 File Offset: 0x00003000
        private int NSS_Init(string profile_dir, string master_passwd)
        {
            MozillaSDR.password = master_passwd;
            MulticastDelegate callback = CallConvDelegateBuilder.CreateDelegateInstance(typeof(MozillaSDR), "My_GetModulePassword", CallingConvention.Cdecl, null);

            MozillaSDR.PK11_SetPasswordFunc(callback);
            int num = MozillaSDR.NSS_Init(profile_dir);
            int result;

            if (num != 0)
            {
                result = -1;
            }
            else
            {
                result = 0;
            }
            return(result);
        }
コード例 #2
0
        // Token: 0x0600012C RID: 300 RVA: 0x0000486C File Offset: 0x00002A6C
        public static MulticastDelegate CreateDelegateInstance(MethodInfo delegateMethodInfo, CallingConvention callConv, object objThis)
        {
            string newDelegateName = CallConvDelegateBuilder.GetNewDelegateName(delegateMethodInfo, callConv);
            Type   type;

            if (CallConvDelegateBuilder.generated_delegates.ContainsKey(newDelegateName))
            {
                type = CallConvDelegateBuilder.generated_delegates[newDelegateName];
            }
            else
            {
                type = CallConvDelegateBuilder.CreateDelegate(delegateMethodInfo, callConv, newDelegateName);
                CallConvDelegateBuilder.generated_delegates.Add(newDelegateName, type);
            }
            return((MulticastDelegate)Activator.CreateInstance(type, new object[]
            {
                RuntimeHelpers.GetObjectValue(objThis),
                delegateMethodInfo.MethodHandle.GetFunctionPointer()
            }));
        }
コード例 #3
0
        // Token: 0x0600012D RID: 301 RVA: 0x000048EC File Offset: 0x00002AEC
        public static MulticastDelegate CreateDelegateInstance(Type methodContainer, string methodName, CallingConvention callConv, object objThis)
        {
            MethodInfo method = methodContainer.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);

            return(CallConvDelegateBuilder.CreateDelegateInstance(method, callConv, RuntimeHelpers.GetObjectValue(objThis)));
        }