Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate key exception in GetRemoteObject #18

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

theXappy
Copy link
Owner

@theXappy theXappy commented Oct 24, 2024

Fixes #17

Fix the issue of duplicate key exception when using GetRemoteObject multiple times on the same Candidate/address.

  • Add IsFrozen method in MsvcFrozenItemsCollection class

    • Add a method IsFrozen to check if an object is already frozen.
    • Implement the IsFrozen method to return true if the object is in _frozenItemsToDestructors.
  • Modify MakeObjectResponse method in MsvcDiver class

    • Check if an object is already frozen before attempting to freeze it.
    • Use the IsFrozen method from MsvcFrozenItemsCollection to check if an object is already frozen.
    • Return the already frozen object if it is found to be frozen.

For more details, open the Copilot Workspace session.

Fixes #17

Fix the issue of duplicate key exception when using `GetRemoteObject` multiple times on the same Candidate/address.

* **Add `IsFrozen` method in `MsvcFrozenItemsCollection` class**
  - Add a method `IsFrozen` to check if an object is already frozen.
  - Implement the `IsFrozen` method to return true if the object is in `_frozenItemsToDestructors`.

* **Modify `MakeObjectResponse` method in `MsvcDiver` class**
  - Check if an object is already frozen before attempting to freeze it.
  - Use the `IsFrozen` method from `MsvcFrozenItemsCollection` to check if an object is already frozen.
  - Return the already frozen object if it is found to be frozen.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/theXappy/RemoteNET/issues/17?shareId=XXXX-XXXX-XXXX-XXXX).
@theXappy theXappy merged commit cc32ecd into main Oct 24, 2024
2 checks passed
@theXappy theXappy deleted the fix-duplicate-key-exception branch October 24, 2024 16:08
theXappy pushed a commit that referenced this pull request Nov 22, 2024
Fix duplicate key exception in GetRemoteObject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trying to "Get Object"/"Freeze Object" twice in Unmanaged App results in "duplicate key exception"
1 participant