139 : struct
140 {
142 Helpers.CheckDisposed(this, intPtr);
143 if (data != null)
144 {
145 int num = data.Length;
146 if (num != 0)
147 {
148 int num2 = -2147467259;
150 {
151 int num3 = 0;
154 if (0 < currentVertexBufferCount)
155 {
156 VertexBufferBinding[] currentVertexBuffers = parent.currentVertexBuffers;
157 do
158 {
159 if (currentVertexBuffers[num3]._vertexBuffer != this)
160 {
161 num3++;
162 continue;
163 }
164 throw GraphicsHelpers.GetExceptionFromResult(2147500036u);
165 }
166 while (num3 < currentVertexBufferCount);
167 }
168 }
169 if (!isSetting && (
_usage & 8) == 8)
170 {
172 }
173 Helpers.ValidateCopyParameters(num,
startIndex, elementCount);
174 try
175 {
177 uint num5 = num4 * (uint)elementCount;
178 int num6;
179 if (vertexStride != 0)
180 {
181 num6 = vertexStride - (int)num4;
182 if (num6 < 0)
183 {
185 }
186 if (elementCount > 1)
187 {
188 num5 = (uint)((elementCount - 1) * num6) + num5;
189 }
190 }
191 else
192 {
193 num6 = 0;
194 }
195 if ((uint)((int)num5 + offsetInBytes) >
_size)
196 {
198 }
200 {
201 if (isSetting)
202 {
203 return;
204 }
206 {
207 try
208 {
209
211 }
212 catch
213 {
214
215 ptr = null;
216 throw;
217 }
218 }
219 return;
220 }
221 void* ptr2 = null;
224 {
225 ptr3 = offsetInBytes + ptr3;
226 }
227 IDirect3DVertexBuffer9* ptr4 =
pComPtr;
228 num2 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, uint,
void**, uint,
int>)(
int)(*(uint*)(*(
int*)ptr4 + 44)))((nint)ptr4, (uint)offsetInBytes, num5, &ptr2,
options);
229 if (num2 >= 0)
230 {
231 if (num6 == 0)
232 {
234 {
235 try
236 {
237 if (isSetting)
238 {
239 _003CModule_003E.memcpy_s(ptr2,
_size - (uint)offsetInBytes, ptr5, num5);
241 {
242 _003CModule_003E.memcpy_s(ptr3,
_size - (uint)offsetInBytes, ptr5, num5);
243 }
244 }
245 else
246 {
247 _003CModule_003E.memcpy_s(ptr5, num5, ptr2, num5);
248 }
249 }
250 catch
251 {
252
253 ptr5 = null;
254 throw;
255 }
256 }
257 }
258 else
259 {
260 byte* ptr6 = (byte*)ptr2;
261 byte* ptr7 = ptr3;
262 for (
int i = 0;
i < elementCount;
i++)
263 {
265 {
266 try
267 {
268 if (isSetting)
269 {
272 {
274 }
275 }
276 else
277 {
279 }
280 ptr6 = vertexStride + ptr6;
282 {
283 ptr7 = vertexStride + ptr7;
284 }
285 }
286 catch
287 {
288
289 ptr8 = null;
290 throw;
291 }
292 }
293 }
294 }
295 }
296 }
297 finally
298 {
299 if (num2 >= 0)
300 {
301 IDirect3DVertexBuffer9* intPtr2 =
pComPtr;
302 num2 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr,
int>)(
int)(*(uint*)(*(
int*)intPtr2 + 48)))((nint)intPtr2);
303 }
304 }
305 if (num2 < 0)
306 {
307 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
308 }
309 if (isSetting && this is IDynamicGraphicsResource dynamicGraphicsResource)
310 {
311 dynamicGraphicsResource.SetContentLost(isContentLost: false);
312 }
313 return;
314 }
315 }
317 }
int currentVertexBufferCount
GraphicsDevice GraphicsDevice
unsafe void * pBufferData
unsafe IDirect3DVertexBuffer9 * pComPtr
static unsafe void InitBlock(void *startAddress, byte value, uint byteCount)