1 /*******************************************************************************
2 * Copyright (c) 2000, 2017 IBM Corporation and others.
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/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.internal.ole.win32;
16 public class IStorage extends IUnknown
18 public IStorage(long address) {
21 public int Commit(int grfCommitFlag) {
22 return COM.VtblCall(9, address, grfCommitFlag);
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
30 // we only support snbExclude = null
31 if (snbExclude != null) {
32 return COM.E_INVALIDARG;
34 return COM.VtblCall(7, address, ciidExclude, rgiidExclude, 0, pstgDest);
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
44 // create a null terminated array of char
46 if (pwcsName != null) {
47 buffer = (pwcsName+"\0").toCharArray();
50 return COM.VtblCall(3, address, buffer, grfMode, reserved1, reserved2, ppStm);
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
61 // create a null terminated array of char
63 if (pwcsName != null) {
64 buffer = (pwcsName+"\0").toCharArray();
67 return COM.VtblCall(4, address, buffer, reserved1, grfMode, reserved2, ppStm);