Skip to content

Commit

Permalink
Tag API leaking Windows OLE methods/fields as non-api
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Mar 15, 2024
1 parent 7479681 commit 1b6c79d
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 58 deletions.
99 changes: 41 additions & 58 deletions binaries/org.eclipse.swt.win32.win32.x86_64/.settings/.api_filters
Expand Up @@ -249,128 +249,111 @@
</filter>
</resource>
<resource path="Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java" type="org.eclipse.swt.ole.win32.OleAutomation">
<filter id="643842064">
<filter id="338944126">
<message_arguments>
<message_argument value="TYPEATTR"/>
<message_argument value="OleAutomation"/>
<message_argument value="org.eclipse.swt.ole.win32.OleAutomation"/>
<message_argument value="getTypeInfoAttributes()"/>
</message_arguments>
</filter>
</resource>
<resource path="Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java" type="org.eclipse.swt.ole.win32.OleClientSite">
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="GUID"/>
<message_argument value="OleClientSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="appClsid"/>
</message_arguments>
</filter>
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="IOleCommandTarget"/>
<message_argument value="OleClientSite"/>
<message_argument value="objIOleCommandTarget"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="objDocumentView"/>
</message_arguments>
</filter>
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="IOleDocumentView"/>
<message_argument value="OleClientSite"/>
<message_argument value="objDocumentView"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="objIOleCommandTarget"/>
</message_arguments>
</filter>
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="IOleInPlaceObject"/>
<message_argument value="OleClientSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="objIOleInPlaceObject"/>
</message_arguments>
</filter>
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="IOleObject"/>
<message_argument value="OleClientSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="objIOleObject"/>
</message_arguments>
</filter>
<filter id="627060751">
<message_arguments>
<message_argument value="IStorage"/>
<message_argument value="OleClientSite"/>
<message_argument value="tempStorage"/>
</message_arguments>
</filter>
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="IUnknown"/>
<message_argument value="OleClientSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="objIUnknown"/>
</message_arguments>
</filter>
<filter id="627060751">
<filter id="338940029">
<message_arguments>
<message_argument value="IViewObject2"/>
<message_argument value="OleClientSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="objIViewObject2"/>
</message_arguments>
</filter>
<filter id="643842064">
<filter id="338940029">
<message_arguments>
<message_argument value="GUID"/>
<message_argument value="OleClientSite"/>
<message_argument value="getClassID(String)"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="tempStorage"/>
</message_arguments>
</filter>
<filter id="643842064">
<filter id="338944126">
<message_arguments>
<message_argument value="IStorage"/>
<message_argument value="OleClientSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="createTempStorage()"/>
</message_arguments>
</filter>
<filter id="338944126">
<message_arguments>
<message_argument value="org.eclipse.swt.ole.win32.OleClientSite"/>
<message_argument value="getClassID(String)"/>
</message_arguments>
</filter>
</resource>
<resource path="Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java" type="org.eclipse.swt.ole.win32.OleControlSite">
<filter id="643846161">
<filter id="338944126">
<message_arguments>
<message_argument value="GUID"/>
<message_argument value="OleControlSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleControlSite"/>
<message_argument value="getLicenseInfo(GUID)"/>
</message_arguments>
</filter>
<filter id="643846161">
<filter id="338944126">
<message_arguments>
<message_argument value="GUID"/>
<message_argument value="OleControlSite"/>
<message_argument value="org.eclipse.swt.ole.win32.OleControlSite"/>
<message_argument value="removeEventListener(OleAutomation, GUID, int, OleListener)"/>
</message_arguments>
</filter>
</resource>
<resource path="Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/Variant.java" type="org.eclipse.swt.ole.win32.Variant">
<filter id="643842064">
<filter id="338944126">
<message_arguments>
<message_argument value="IDispatch"/>
<message_argument value="Variant"/>
<message_argument value="org.eclipse.swt.ole.win32.Variant"/>
<message_argument value="getDispatch()"/>
</message_arguments>
</filter>
<filter id="643842064">
<filter id="338944126">
<message_arguments>
<message_argument value="IUnknown"/>
<message_argument value="Variant"/>
<message_argument value="org.eclipse.swt.ole.win32.Variant"/>
<message_argument value="getUnknown()"/>
</message_arguments>
</filter>
<filter id="643850349">
<filter id="338948223">
<message_arguments>
<message_argument value="IDispatch"/>
<message_argument value="Variant"/>
<message_argument value="org.eclipse.swt.ole.win32.Variant"/>
<message_argument value="Variant(IDispatch)"/>
</message_arguments>
</filter>
<filter id="643850349">
<filter id="338948223">
<message_arguments>
<message_argument value="IUnknown"/>
<message_argument value="Variant"/>
<message_argument value="org.eclipse.swt.ole.win32.Variant"/>
<message_argument value="Variant(IUnknown)"/>
</message_arguments>
</filter>
Expand Down
Expand Up @@ -347,6 +347,7 @@ public OleFunctionDescription getFunctionDescription(int index) {
* the member descriptions and attributes of the type.
*
* @return the type info of the receiver
* @noreference This method is not intended to be referenced by clients.
*/
public TYPEATTR getTypeInfoAttributes() {
if (objITypeInfo == null) return null;
Expand Down
Expand Up @@ -55,6 +55,7 @@ public class OleClientSite extends Composite {
private COMObject iOleInPlaceSite;
private COMObject iOleDocumentSite;

/** @noreference This field is not intended to be referenced by clients. */
protected GUID appClsid;
private GUID objClsid;
private int refCount;
Expand All @@ -63,14 +64,21 @@ public class OleClientSite extends Composite {
protected OleFrame frame;

// Access to the embedded/linked Ole Object
/** @noreference This field is not intended to be referenced by clients. */
protected IUnknown objIUnknown;
/** @noreference This field is not intended to be referenced by clients. */
protected IOleObject objIOleObject;
/** @noreference This field is not intended to be referenced by clients. */
protected IViewObject2 objIViewObject2;
/** @noreference This field is not intended to be referenced by clients. */
protected IOleInPlaceObject objIOleInPlaceObject;
/** @noreference This field is not intended to be referenced by clients. */
protected IOleCommandTarget objIOleCommandTarget;
/** @noreference This field is not intended to be referenced by clients. */
protected IOleDocumentView objDocumentView;

// Related storage information
/** @noreference This field is not intended to be referenced by clients. */
protected IStorage tempStorage; // IStorage interface of the receiver

// Internal state and style information
Expand Down Expand Up @@ -578,6 +586,11 @@ protected void createCOMInterfaces() {
public long method3(long[] args) {return ActivateMe(args[0]);}
};
}

/**
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
protected IStorage createTempStorage() {
long[] tempStorage = new long[1];
int grfMode = COM.STGM_READWRITE | COM.STGM_SHARE_EXCLUSIVE | COM.STGM_DELETEONRELEASE;
Expand Down Expand Up @@ -701,6 +714,10 @@ IDispatch getAutomationObject() {
return null;
return new IDispatch(ppvObject[0]);
}
/**
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
protected GUID getClassID(String clientName) {
// create a GUID struct to hold the result
GUID guid = new GUID();
Expand Down
Expand Up @@ -574,6 +574,10 @@ public Color getForeground () {

return super.getForeground();
}
/**
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
protected long getLicenseInfo(GUID clsid) {
long[] ppvObject = new long[1];
if (COM.CoGetClassObject(clsid, COM.CLSCTX_INPROC_HANDLER
Expand Down Expand Up @@ -841,6 +845,8 @@ public void removeEventListener(int eventID, OleListener listener) {
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT when listener is null</li>
* </ul>
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
@Deprecated
public void removeEventListener(OleAutomation automation, GUID guid, int eventID, OleListener listener) {
Expand Down
Expand Up @@ -171,6 +171,7 @@ public Variant(OleAutomation automation) {
* @since 2.0
*
* @param idispatch the IDispatch object that this Variant represents
* @noreference This constructor is not intended to be referenced by clients.
*/
public Variant(IDispatch idispatch) {
type = COM.VT_DISPATCH;
Expand All @@ -183,6 +184,7 @@ public Variant(IDispatch idispatch) {
* this Variant.
*
* @param unknown the IUnknown object that this Variant represents
* @noreference This constructor is not intended to be referenced by clients.
*/
public Variant(IUnknown unknown) {
type = COM.VT_UNKNOWN;
Expand Down Expand Up @@ -305,6 +307,7 @@ public OleAutomation getAutomation() {
* @exception SWTException <ul>
* <li>ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into an IDispatch object</li>
* </ul>
* @noreference This method is not intended to be referenced by clients.
*/
public IDispatch getDispatch() {
if (type == COM.VT_EMPTY) {
Expand Down Expand Up @@ -801,6 +804,7 @@ public short getType() {
* <li>ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into
* an IUnknown object</li>
* </ul>
* @noreference This method is not intended to be referenced by clients.
*/
public IUnknown getUnknown() {
if (type == COM.VT_EMPTY) {
Expand Down

0 comments on commit 1b6c79d

Please sign in to comment.