예제 #1
0
            // CleanUp operations

            private void CleanUpPOD(IntPtr native)
            {
                Marshal.FreeCoTaskMem(Marshal.ReadIntPtr(native, newFileSymbolPathOffset));

                if (IntPtr.Zero != Marshal.ReadIntPtr(native, oldFileSymbolPathArrayOffset))
                {
                    for (int i = 0; i < GetOldFileCount(native); ++i)
                    {
                        Marshal.FreeCoTaskMem(
                            Marshal.ReadIntPtr(
                                Marshal.ReadIntPtr(native, oldFileSymbolPathArrayOffset),
                                i * Marshal.SizeOf(typeof(IntPtr))));
                    }

                    Marshal.FreeCoTaskMem(Marshal.ReadIntPtr(native, oldFileSymbolPathArrayOffset));
                }

                if (IntPtr.Zero != Marshal.ReadIntPtr(native, interleaveMapArrayOffset))
                {
                    for (int i = 0; i < GetOldFileCount(native); ++i)
                    {
                        Marshal.FreeCoTaskMem(
                            Marshal.ReadIntPtr(
                                Marshal.ReadIntPtr(native, interleaveMapArrayOffset),
                                i * Marshal.SizeOf(typeof(IntPtr))));
                    }

                    Marshal.FreeCoTaskMem(Marshal.ReadIntPtr(native, interleaveMapArrayOffset));
                }

                PatchAPIMarshaler.ReleaseMainStruct(native);
            }
예제 #2
0
            private void CleanUpPOFI_A(IntPtr native)
            {
                for (int i = 0; i < GetOldFileCount(native); ++i)
                {
                    PatchAPIMarshaler.CleanUpPOFI((IntPtr)((Int64)native + i * patchOldFileInfoSize));
                }

                PatchAPIMarshaler.ReleaseMainStruct(native);
            }