1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
/*******************************************************************************
* Copyright (c) 2000, 2017 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.internal.ole.win32;
import org.eclipse.swt.internal.win32.*;
public class IStorage extends IUnknown
{
public IStorage(long /*int*/ address) {
super(address);
}
public int Commit(int grfCommitFlag) {
return OS.VtblCall(9, address, grfCommitFlag);
}
public int CopyTo(
int ciidExclude, //Number of elements in rgiidExclude
GUID rgiidExclude, //Array of interface identifiers (IIDs)
String[] snbExclude, //Points to a block of stream names in the storage object
long /*int*/ pstgDest //Points to destination storage object
){
// we only support snbExclude = null
if (snbExclude != null) {
return COM.E_INVALIDARG;
}
return COM.VtblCall(7, address, ciidExclude, rgiidExclude, 0, pstgDest);
}
public int CreateStorage(
String pwcsName, //Pointer to the name of the new storage object
int grfMode, //Access mode for the new storage object
int reserved1, //Reserved; must be zero
int reserved2, //Reserved; must be zero
long /*int*/[] ppStg //Pointer to new storage object
){
// create a null terminated array of char
char[] buffer = null;
if (pwcsName != null) {
buffer = (pwcsName+"\0").toCharArray();
}
return COM.VtblCall(5, address, buffer, grfMode, reserved1, reserved2, ppStg);
}
public int CreateStream(
String pwcsName, //Pointer to the name of the new stream
int grfMode, //Access mode for the new stream
int reserved1, //Reserved; must be zero
int reserved2, //Reserved; must be zero
long /*int*/[] ppStm //Pointer to new stream object
){
// create a null terminated array of char
char[] buffer = null;
if (pwcsName != null) {
buffer = (pwcsName+"\0").toCharArray();
}
return COM.VtblCall(3, address, buffer, grfMode, reserved1, reserved2, ppStm);
}
public int DestroyElement(String pwcsName) {
// create a null terminated array of char
char[] buffer = null;
if (pwcsName != null) {
buffer = (pwcsName+"\0").toCharArray();
}
return OS.VtblCall(12, address, buffer);
}
public int EnumElements(
int reserved1, //Reserved; must be zero
long /*int*/ reserved2, //Reserved; must be NULL
int reserved3, //Reserved; must be zero
long /*int*/[] ppenum //Pointer to output variable that
// receives the IEnumSTATSTG interface
){
return OS.VtblCall(11, address, reserved1, reserved2, reserved3, ppenum);
}
public int OpenStorage(
String pwcsName, //Pointer to the name of the
// storage object to open
long /*int*/ pstgPriority, //Must be NULL.
int grfMode, //Access mode for the new storage object
String snbExclude[], //Must be NULL.
int reserved, //Reserved; must be zero
long /*int*/[] ppStg //Pointer to opened storage object
){
// create a null terminated array of char
char[] buffer = null;
if (pwcsName != null) {
buffer = (pwcsName+"\0").toCharArray();
}
// we only support the case where snbExclude = null
if (snbExclude != null) {
return COM.E_INVALIDARG;
}
return COM.VtblCall(6, address, buffer, pstgPriority, grfMode, 0, reserved, ppStg);
}
public int OpenStream(
String pwcsName, //Pointer to name of stream to open
long /*int*/ reserved1, //Reserved; must be NULL
int grfMode, //Access mode for the new stream
int reserved2, //Reserved; must be zero
long /*int*/[] ppStm //Pointer to output variable
// that receives the IStream interface pointer
) {
// create a null terminated array of char
char[] buffer = null;
if (pwcsName != null) {
buffer = (pwcsName+"\0").toCharArray();
}
return COM.VtblCall(4, address, buffer, reserved1, grfMode, reserved2, ppStm);
}
public int RenameElement(
String pwcsOldName, //Pointer to the name of the
// element to be changed
String pwcsNewName //Pointer to the new name for
// the specified element
){
// create a null terminated array of char
char[] buffer1 = null;
if (pwcsOldName != null) {
buffer1 = (pwcsOldName+"\0").toCharArray();
}
// create a null terminated array of char
char[] buffer2 = null;
if (pwcsNewName != null) {
buffer2 = (pwcsNewName+"\0").toCharArray();
}
return COM.VtblCall(13, address, buffer1, buffer2);
}
public int Revert() {
return OS.VtblCall(10, address);
}
public int SetClass(
GUID clsid //CLSID to be assigned to the storage object
){
return COM.VtblCall(15, address, clsid);
}
}
|