/// <summary> /// Create a resource updater for the given PE file. This will /// acquire a native resource update handle for the file, /// preparing it for updates. Resources can be added to this /// updater, which will queue them for update. The target PE /// file will not be modified until Update() is called, after /// which the ResourceUpdater can not be used for further /// updates. /// </summary> public ResourceUpdater(string peFile) { hUpdate = Kernel32.BeginUpdateResource(peFile, false); if (hUpdate.IsInvalid) { ThrowExceptionForLastWin32Error(); } }
public static extern bool EndUpdateResource(SafeUpdateHandle hUpdate, bool fDiscard);
public static extern bool UpdateResource(SafeUpdateHandle hUpdate, IntPtr lpType, IntPtr lpName, ushort wLanguage, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5)] byte[] lpData, uint cbData);
public static extern bool UpdateResource(SafeUpdateHandle hUpdate, IntPtr lpType, IntPtr lpName, ushort wLanguage, IntPtr lpData, uint cbData);