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

Use IStorage*/IStream* Instead of Interface #8105

Merged
merged 4 commits into from
Nov 8, 2022

Conversation

lonitra
Copy link
Member

@lonitra lonitra commented Nov 2, 2022

  • Use IStream*/IStorage* instead of interface where appropriate
  • Convert CreateILockBytesOnHGlobal,GetHGlobalFromILockBytes,StgCreateDocfileOnILockBytes,StgOpenStorageOnILockBytes to cswin32
  • Remove LockBytesWrapper
  • Implement basic dispose pattern in AxHost.State to release unmanaged resources
  • Update IPersistStorage::Load/Save methods to return correct HRESULT value
Microsoft Reviewers: Open in CodeFlow

@lonitra lonitra requested a review from a team as a code owner November 2, 2022 21:31
@ghost ghost assigned lonitra Nov 2, 2022
JeremyKuhne
JeremyKuhne previously approved these changes Nov 2, 2022
Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lonitra lonitra merged commit 5cfec9e into dotnet:main Nov 8, 2022
@lonitra lonitra deleted the streamstorageptr branch November 8, 2022 22:40
@ghost ghost added this to the 8.0 Preview1 milestone Nov 8, 2022
@RussKie
Copy link
Member

RussKie commented Nov 9, 2022

Looks like tests failing across multiple agents all with the same error, e.g.: https://dev.azure.com/dnceng-public/public/_build/results?buildId=77220&view=results (#8142)

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Windows.Win32.System.Com.IStream.Release() in /_/src/System.Windows.Forms.Primitives/src/Microsoft.Windows.CsWin32/Microsoft.Windows.CsWin32.SourceGenerator/Windows.Win32.IStream.g.cs:line 55
   at System.Windows.Forms.DataStreamFromComStream.Dispose(Boolean disposing) in /_/src/System.Windows.Forms/src/System/Windows/Forms/DataStreamFromComStream.cs:line 158
   at System.Windows.Forms.DataStreamFromComStream.Finalize() in /_/src/System.Windows.Forms/src/System/Windows/Forms/DataStreamFromComStream.cs:line 167

image

finally
{
base.Dispose(disposing);
_comStream->Release();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗ This is causing the NRE in the finalizer. The comment above states that.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants