summaryrefslogtreecommitdiff
path: root/NET/worlds/console/IUnknown.java
blob: b352d0ba4df479e8620d996f3620ca34b14cbb30 (plain) (blame)
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
/*     */ package NET.worlds.console;
/*     */ 
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class IUnknown
/*     */ {
/*  28 */   protected int _pInterface = 0;
/*  29 */   protected int _refs = 0;
/*     */   
/*     */ 
/*     */ 
/*     */   private static final String IID_IUnknown = "{00000000-0000-0000-c000-000000000046}";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public IUnknown()
/*     */     throws IOException
/*     */   {}
/*     */   
/*     */ 
/*     */ 
/*     */   protected synchronized void init(int pInterface)
/*     */     throws IOException
/*     */   {
/*  47 */     assert (pInterface != 0);
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*  54 */     ActiveX.init(this);
/*     */     
/*     */ 
/*     */ 
/*  58 */     this._pInterface = pInterface;
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*  64 */     this._refs = 1;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public IUnknown(String svrID)
/*     */     throws IOException
/*     */   {
/*  72 */     if ((ActiveX.getDebugLevel() & 0x2) > 0) {
/*  73 */       System.out.println(this + ": constructor: svrID = " + svrID);
/*     */     }
/*  75 */     ActiveX.init(this);
/*     */     try
/*     */     {
/*     */       try
/*     */       {
/*  80 */         this._pInterface = ActiveX.getClassFClsID(svrID, "{00000000-0000-0000-c000-000000000046}");
/*  81 */         this._refs += 1;
/*     */       } catch (IOException e) {
/*  83 */         this._pInterface = ActiveX.getClassFProgID(svrID, "{00000000-0000-0000-c000-000000000046}");
/*  84 */         this._refs += 1;
/*     */       }
/*     */       
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*  95 */       if ((ActiveX.getDebugLevel() & 0x2) <= 0) {
/*     */         return;
/*     */       }
/*     */     }
/*     */     catch (IOException e)
/*     */     {
/*  91 */       ActiveX.uninit(this);
/*  92 */       throw e;
/*     */     }
/*     */     
/*     */ 
/*  96 */     System.out.println("IUnknown: constructed " + this);
/*     */   }
/*     */   
/*     */   public IUnknown(String svrID, String intfID)
/*     */     throws IOException
/*     */   {
/* 102 */     if ((ActiveX.getDebugLevel() & 0x2) > 0) {
/* 103 */       System.out.println(this + ": constructor: svrID = " + svrID + 
/* 104 */         ", intfID = " + intfID);
/*     */     }
/* 106 */     init(svrID, intfID);
/*     */     
/* 108 */     if ((ActiveX.getDebugLevel() & 0x2) > 0) {
/* 109 */       System.out.println("IUnknown: constructed " + this);
/*     */     }
/*     */   }
/*     */   
/*     */   protected synchronized void init(String svrID, String intfID) throws IOException
/*     */   {
/* 115 */     ActiveX.init(this);
/*     */     try
/*     */     {
/*     */       try
/*     */       {
/* 120 */         this._pInterface = ActiveX.getClassFClsID(svrID, intfID);
/* 121 */         this._refs += 1;
/*     */       } catch (IOException e) {
/* 123 */         this._pInterface = ActiveX.getClassFProgID(svrID, intfID);
/* 124 */         this._refs += 1;
/*     */       }
/*     */       return;
/*     */     }
/*     */     catch (IOException e) {
/* 129 */       ActiveX.uninit(this);
/* 130 */       throw e;
/*     */     }
/*     */   }
/*     */   
/*     */   public IUnknown(IUnknown parent, String intfID)
/*     */     throws IOException, OLEInvalidObjectException
/*     */   {
/* 137 */     if ((ActiveX.getDebugLevel() & 0x2) > 0) {
/* 138 */       System.out.println(this + ": constructor: parent = " + parent + 
/* 139 */         ", intfID = " + intfID);
/*     */     }
/* 141 */     init(parent, intfID);
/*     */     
/* 143 */     if ((ActiveX.getDebugLevel() & 0x2) > 0) {
/* 144 */       System.out.println("IUnknown: constructed " + this);
/*     */     }
/*     */   }
/*     */   
/*     */   protected synchronized void init(IUnknown parent, String intfID) throws IOException, OLEInvalidObjectException
/*     */   {
/* 150 */     assert (parent != null);
/* 151 */     ActiveX.init(this);
/*     */     try {
/* 153 */       this._pInterface = parent.QueryInterface(intfID);
/* 154 */       this._refs = 1;
/*     */     }
/*     */     catch (IOException e) {
/* 157 */       ActiveX.uninit(this);
/* 158 */       throw e;
/*     */     } catch (OLEInvalidObjectException e) {
/* 160 */       ActiveX.uninit(this);
/* 161 */       throw e;
/*     */     }
/*     */   }
/*     */   
/*     */   public synchronized void Release() throws OLEInvalidObjectException
/*     */   {
/* 167 */     if ((ActiveX.getDebugLevel() & 0x4) > 0) {
/* 168 */       System.out.println(this + ": Releasing");
/*     */     }
/* 170 */     if (this._pInterface == 0)
/* 171 */       throw new OLEInvalidObjectException();
/* 172 */     if ((this._pInterface != 0) && (this._refs > 0))
/* 173 */       true_Release();
/* 174 */     this._refs -= 1;
/* 175 */     if (this._refs == 0)
/*     */     {
/*     */ 
/*     */ 
/* 179 */       this._pInterface = 0;
/* 180 */       ActiveX.uninit(this);
/*     */     }
/*     */   }
/*     */   
/*     */   public void finalize()
/*     */   {
/* 186 */     if (this._pInterface != 0)
/*     */     {
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 195 */       while (this._refs > 0) {
/*     */         try {
/* 197 */           Release();
/*     */         } catch (OLEInvalidObjectException e) {
/* 199 */           System.out.println("DEBUG: " + this);
/* 200 */           if (!$assertionsDisabled) throw new AssertionError();
/*     */         }
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   public synchronized void AddRef() throws OLEInvalidObjectException
/*     */   {
/* 208 */     if ((ActiveX.getDebugLevel() & 0x4) > 0) {
/* 209 */       System.out.println(this + ": AddingRef");
/*     */     }
/* 211 */     if (this._pInterface == 0)
/* 212 */       throw new OLEInvalidObjectException();
/* 213 */     this._refs += 1;
/* 214 */     true_AddRef();
/*     */   }
/*     */   
/*     */   public native void true_AddRef();
/*     */   
/*     */   public native int QueryInterface(String paramString) throws IOException, OLEInvalidObjectException;
/*     */   
/*     */   public native void true_Release() throws OLEInvalidObjectException;
/*     */   
/*     */   protected native int getPtr() throws OLEInvalidObjectException;
/*     */   
/*     */   public String internalData()
/*     */   {
/* 227 */     return "_pInterface=" + this._pInterface + ", _refs=" + this._refs;
/*     */   }
/*     */   
/*     */   public String toString()
/*     */   {
/* 232 */     return "IUnknown(" + internalData() + ")";
/*     */   }
/*     */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\IUnknown.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */