Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ec353e2

Browse files
authored
Missing guid from two interop types (#26688)
* Add missing Guids to two interfaces * Curly
1 parent 2148656 commit ec353e2

File tree

2 files changed

+115
-13
lines changed

2 files changed

+115
-13
lines changed

src/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComTypes/IDataObject.cs

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,85 @@
44

55
namespace System.Runtime.InteropServices.ComTypes
66
{
7+
/// <devdoc>
8+
/// The IDataObject interface specifies methods that enable data transfer
9+
/// and notification of changes in data. Data transfer methods specify
10+
/// the format of the transferred data along with the medium through
11+
/// which the data is to be transferred. Optionally, the data can be
12+
/// rendered for a specific target device. In addition to methods for
13+
/// retrieving and storing data, the IDataObject interface specifies
14+
/// methods for enumerating available formats and managing connections
15+
/// to advisory sinks for handling change notifications.
16+
/// </devdoc>
717
[CLSCompliant(false)]
8-
public interface IDataObject
9-
{
10-
int DAdvise(ref FORMATETC pFormatetc, ADVF advf, IAdviseSink adviseSink, out int connection);
18+
[ComImport()]
19+
[Guid("0000010E-0000-0000-C000-000000000046")]
20+
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
21+
public interface IDataObject {
22+
23+
/// <devdoc>
24+
/// Called by a data consumer to obtain data from a source data object.
25+
/// The GetData method renders the data described in the specified FORMATETC
26+
/// structure and transfers it through the specified STGMEDIUM structure.
27+
/// The caller then assumes responsibility for releasing the STGMEDIUM structure.
28+
/// </devdoc>
29+
void GetData([In] ref FORMATETC format, out STGMEDIUM medium);
30+
31+
/// <devdoc>
32+
/// Called by a data consumer to obtain data from a source data object.
33+
/// This method differs from the GetData method in that the caller must
34+
/// allocate and free the specified storage medium.
35+
/// </devdoc>
36+
void GetDataHere([In] ref FORMATETC format, ref STGMEDIUM medium);
37+
38+
/// <devdoc>
39+
/// Determines whether the data object is capable of rendering the data
40+
/// described in the FORMATETC structure. Objects attempting a paste or
41+
/// drop operation can call this method before calling IDataObject::GetData
42+
/// to get an indication of whether the operation may be successful.
43+
/// </devdoc>
44+
[PreserveSig]
45+
int QueryGetData([In] ref FORMATETC format);
46+
47+
/// <devdoc>
48+
/// Provides a standard FORMATETC structure that is logically equivalent to one that is more
49+
/// complex. You use this method to determine whether two different
50+
/// FORMATETC structures would return the same data, removing the need
51+
/// for duplicate rendering.
52+
/// </devdoc>
53+
[PreserveSig]
54+
int GetCanonicalFormatEtc([In] ref FORMATETC formatIn, out FORMATETC formatOut);
55+
56+
/// <devdoc>
57+
/// Called by an object containing a data source to transfer data to
58+
/// the object that implements this method.
59+
/// </devdoc>
60+
void SetData([In] ref FORMATETC formatIn, [In] ref STGMEDIUM medium, [MarshalAs(UnmanagedType.Bool)] bool release);
61+
62+
/// <devdoc>
63+
/// Creates an object for enumerating the FORMATETC structures for a
64+
/// data object. These structures are used in calls to IDataObject::GetData
65+
/// or IDataObject::SetData.
66+
/// </devdoc>
67+
IEnumFORMATETC EnumFormatEtc(DATADIR direction);
68+
69+
/// <devdoc>
70+
/// Called by an object supporting an advise sink to create a connection between
71+
/// a data object and the advise sink. This enables the advise sink to be
72+
/// notified of changes in the data of the object.
73+
/// </devdoc>
74+
[PreserveSig]
75+
int DAdvise([In] ref FORMATETC pFormatetc, ADVF advf, IAdviseSink adviseSink, out int connection);
76+
77+
/// <devdoc>
78+
/// Destroys a notification connection that had been previously set up.
79+
/// </devdoc>
1180
void DUnadvise(int connection);
81+
82+
/// <devdoc>
83+
/// Creates an object that can be used to enumerate the current advisory connections.
84+
/// </devdoc>
85+
[PreserveSig]
1286
int EnumDAdvise(out IEnumSTATDATA enumAdvise);
13-
IEnumFORMATETC EnumFormatEtc(DATADIR direction);
14-
int GetCanonicalFormatEtc(ref FORMATETC formatIn, out FORMATETC formatOut);
15-
void GetData(ref FORMATETC format, out STGMEDIUM medium);
16-
void GetDataHere(ref FORMATETC format, ref STGMEDIUM medium);
17-
int QueryGetData(ref FORMATETC format);
18-
void SetData(ref FORMATETC formatIn, ref STGMEDIUM medium, bool release);
1987
}
2088
}

src/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComTypes/IEnumSTATDATA.cs

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,46 @@
44

55
namespace System.Runtime.InteropServices.ComTypes
66
{
7-
[CLSCompliant(false)]
7+
/// <devdoc>
8+
/// The IEnumSTATDATA interface is used to enumerate through an array of
9+
/// STATDATA structures, which contain advisory connection information for
10+
/// a data object. IEnumSTATDATA has the same methods as all enumerator
11+
/// interfaces: Next, Skip, Reset, and Clone.
12+
/// </devdoc>
13+
[ComImport()]
14+
[Guid("00000103-0000-0000-C000-000000000046")]
15+
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
816
public interface IEnumSTATDATA
917
{
10-
void Clone(out IEnumSTATDATA newEnum);
11-
int Next(int celt, STATDATA[] rgelt, int[] pceltFetched);
12-
int Reset();
18+
19+
/// <devdoc>
20+
/// Retrieves the next celt items in the enumeration sequence. If there are
21+
/// fewer than the requested number of elements left in the sequence, it
22+
/// retrieves the remaining elements. The number of elements actually
23+
/// retrieved is returned through pceltFetched (unless the caller passed
24+
/// in NULL for that parameter).
25+
/// </devdoc>
26+
[PreserveSig]
27+
int Next(int celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] STATDATA[] rgelt, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=1)] int[] pceltFetched);
28+
29+
/// <devdoc>
30+
/// Skips over the next specified number of elements in the enumeration sequence.
31+
/// </devdoc>
32+
[PreserveSig]
1333
int Skip(int celt);
34+
35+
/// <devdoc>
36+
/// Resets the enumeration sequence to the beginning.
37+
/// </devdoc>
38+
[PreserveSig]
39+
int Reset();
40+
41+
/// <devdoc>
42+
/// Creates another enumerator that contains the same enumeration state as
43+
/// the current one. Using this function, a client can record a particular
44+
/// point in the enumeration sequence and then return to that point at a
45+
/// later time. The new enumerator supports the same interface as the original one.
46+
/// </devdoc>
47+
void Clone(out IEnumSTATDATA newEnum);
1448
}
1549
}

0 commit comments

Comments
 (0)