private static IEnumerable <NdrComplexTypeReference> ReadPicklingComplexTypes(NdrParserFlags parser_flags, NtProcess process, IntPtr midl_type_pickling_info, IntPtr midl_stub_desc, bool deref_stub_desc, Func <IMemoryReader, IntPtr, IEnumerable <int> > get_offsets)
        {
            NdrParser parser = new NdrParser(process, null, parser_flags);

            RunWithAccessCatch(() => parser.ReadTypes(midl_type_pickling_info, midl_stub_desc, deref_stub_desc, get_offsets));
            return(parser.ComplexTypes);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parse NDR complex type information from a pickling structure. Used to extract explicit Encode/Decode method information.
        /// </summary>
        /// <param name="process">The process to read from.</param>
        /// <param name="midl_type_pickling_info">Pointer to the MIDL_TYPE_PICKLING_INFO structure.</param>
        /// <param name="midl_stub_desc">The pointer to the MIDL_STUB_DESC structure.</param>
        /// <param name="start_offsets">Offsets into the format string to the start of the types.</param>
        /// <returns>The list of complex types.</returns>
        /// <remarks>This function is used to extract type information for calls to NdrMesTypeDecode2. MIDL_TYPE_PICKLING_INFO is the second parameter,
        /// MIDL_STUB_DESC is the third (minus the offset).</remarks>
        public static IEnumerable <NdrComplexTypeReference> ReadPicklingComplexTypes(NtProcess process, IntPtr midl_type_pickling_info, IntPtr midl_stub_desc, params int[] start_offsets)
        {
            if (start_offsets.Length == 0)
            {
                return(new NdrComplexTypeReference[0]);
            }

            NdrParser parser = new NdrParser(process, null, NdrParserFlags.IgnoreUserMarshal);

            RunWithAccessCatch(() => parser.ReadTypes(midl_type_pickling_info, midl_stub_desc, start_offsets));
            return(parser.ComplexTypes);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Parse NDR complex type information from a pickling structure. Used to extract explicit Encode/Decode method information.
        /// </summary>
        /// <param name="process">The process to read from.</param>
        /// <param name="midl_type_pickling_info">Pointer to the MIDL_TYPE_PICKLING_INFO structure.</param>
        /// <param name="format_string">The format string to read from.</param>
        /// <param name="start_offsets">Offsets into the format string to the start of the types.</param>
        /// <returns>The list of complex types.</returns>
        /// <remarks>This function is used to extract type information for calls to NdrMesTypeDecode2. MIDL_TYPE_PICKLING_INFO is the second parameter,
        /// format_string is the third (minus the offset).</remarks>
        public static IEnumerable <NdrComplexTypeReference> ReadPicklingComplexTypes(NtProcess process, IntPtr midl_type_pickling_info, IntPtr format_string, params int[] start_offsets)
        {
            if (start_offsets.Length == 0)
            {
                return(new NdrComplexTypeReference[0]);
            }

            NdrParser parser = new NdrParser(process, null, NdrParserFlags.IgnoreUserMarshal);

            parser.ReadTypes(midl_type_pickling_info, format_string, start_offsets);
            return(parser.ComplexTypes);
        }