]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/internal/ole/win32/IStorage.java
Work around SWT 4.13 - 4.18 Win32 DnD bug 567422
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / internal / ole / win32 / IStorage.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2017 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.internal.ole.win32;
15
16 public class IStorage extends IUnknown
17 {
18 public IStorage(long address) {
19         super(address);
20 }
21 public int Commit(int grfCommitFlag) {
22         return COM.VtblCall(9, address, grfCommitFlag);
23 }
24 public int CopyTo(
25         int ciidExclude,     //Number of elements in rgiidExclude
26         GUID rgiidExclude,   //Array of interface identifiers (IIDs)
27         String[] snbExclude, //Points to a block of stream names in the storage object
28         long pstgDest         //Points to destination storage object
29         ){
30         // we only support snbExclude = null
31         if (snbExclude != null) {
32                 return COM.E_INVALIDARG;
33         }
34         return COM.VtblCall(7, address, ciidExclude, rgiidExclude, 0, pstgDest);
35 }
36 public int CreateStream(
37         String pwcsName, //Pointer to the name of the new stream
38         int grfMode,     //Access mode for the new stream
39         int reserved1,   //Reserved; must be zero
40         int reserved2,   //Reserved; must be zero
41         long[] ppStm      //Pointer to new stream object
42 ){
43
44         // create a null terminated array of char
45         char[] buffer = null;
46         if (pwcsName != null) {
47                 buffer = (pwcsName+"\0").toCharArray();
48         }
49
50         return COM.VtblCall(3, address, buffer, grfMode, reserved1, reserved2, ppStm);
51 }
52 public int OpenStream(
53         String pwcsName, //Pointer to name of stream to open
54         long reserved1,   //Reserved; must be NULL
55         int grfMode,     //Access mode for the new stream
56         int reserved2,   //Reserved; must be zero
57         long[] ppStm      //Pointer to output variable
58                          // that receives the IStream interface pointer
59 ) {
60
61         // create a null terminated array of char
62         char[] buffer = null;
63         if (pwcsName != null) {
64                 buffer = (pwcsName+"\0").toCharArray();
65         }
66
67         return COM.VtblCall(4, address, buffer, reserved1, grfMode, reserved2, ppStm);
68 }
69 }