Skip to content

Enable nullable: System.Management.Automation.IDispatch - #14185

Merged
Ilya (iSazonov) merged 3 commits into
PowerShell:masterfrom
powercode:nullable/IDispatch
May 26, 2021
Merged

Enable nullable: System.Management.Automation.IDispatch#14185
Ilya (iSazonov) merged 3 commits into
PowerShell:masterfrom
powercode:nullable/IDispatch

Conversation

@powercode

Copy link
Copy Markdown
Collaborator

Tracking issue: #12631.

@ghost ghost added the Review - Needed The PR is being reviewed label Nov 28, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@rjmholt

Copy link
Copy Markdown
Collaborator

Don't know about this one -- COM isn't my area

@ghost ghost removed the Review - Needed The PR is being reviewed label Dec 11, 2020
@iSazonov

Ilya (iSazonov) commented Dec 11, 2020

Copy link
Copy Markdown
Collaborator

Dongbo Wang (@daxian-dbw) Could you please look? There is a difference with .Net Runtime
https://github.com/dotnet/runtime/blob/1d9e50cb4735df46d3de0cee5791e97295eaf588/src/libraries/Common/src/System/Runtime/InteropServices/IDispatch.cs#L25-L35

GitHub
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps. - dotnet/runtime

@powercode

Staffan Gustafsson (powercode) commented Dec 14, 2020

Copy link
Copy Markdown
Collaborator Author

The relevant docs are here:
https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nf-oaidl-idispatch-gettypeinfo
https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nf-oaidl-idispatch-invoke

Retrieves the type information for an object, which can then be used to get the type information for an interface.
Provides access to properties and methods exposed by an object.

COM.INVOKEKIND wFlags,
[In, Out][MarshalAs(UnmanagedType.LPArray)] COM.DISPPARAMS[] paramArray,
out object pVarResult,
out object? pVarResult,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VARIANT *pVarResult,

Pointer to the location where the result is to be stored, or NULL if the caller expects no result. This argument is ignored if DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF is specified.

[In, Out][MarshalAs(UnmanagedType.LPArray)] COM.DISPPARAMS[] paramArray,
out object pVarResult,
out object? pVarResult,
out ComInvoker.EXCEPINFO pExcepInfo,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

EXCEPINFO* pExcepInfo

Pointer to a structure that contains exception information. This structure should be filled in if DISP_E_EXCEPTION is returned. Can be NULL.

This can be null, but as we use a struct for ComInvoker.EXCEPTINFO, it shouldn't be marked as ?

@SteveL-MSFT Steve Lee (SteveL-MSFT) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Dec 15, 2020
@ghost ghost added the Review - Needed The PR is being reviewed label Dec 23, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

Comment thread src/System.Management.Automation/engine/COM/ComDispatch.cs Outdated
Comment thread src/System.Management.Automation/engine/COM/ComDispatch.cs
@powercode

Copy link
Copy Markdown
Collaborator Author

ppTInfo can for sure be null.

@iSazonov
Ilya (iSazonov) merged commit 6361141 into PowerShell:master May 26, 2021
@ghost ghost removed the Review - Needed The PR is being reviewed label May 26, 2021
@iSazonov Ilya (iSazonov) added this to the 7.2.0-preview.6 milestone May 26, 2021
@TravisEz13 Travis Plunk (TravisEz13) removed this from the 7.2.0-preview.6 milestone May 27, 2021
@powercode
Staffan Gustafsson (powercode) deleted the nullable/IDispatch branch June 24, 2021 07:45
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants