Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
/SharpDXPublic archive

Commitb9f7519

Browse files
author
AndrewSt
committed
Fix bug in#785 in DataStream
1 parent0fe1315 commitb9f7519

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Source/SharpDX/DataStream.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@ public static DataStream Create<T>(T[] userBuffer, bool canRead, bool canWrite,
106106
DataStreamstream;
107107

108108
varsizeOfBuffer=Utilities.SizeOf(userBuffer);
109+
varindexOffset=index*Utilities.SizeOf<T>();
109110

110111
if(pinBuffer)
111112
{
112113
varhandle=GCHandle.Alloc(userBuffer,GCHandleType.Pinned);
113-
varindexOffset=index*Utilities.SizeOf<T>();
114114
stream=newDataStream(indexOffset+(byte*)handle.AddrOfPinnedObject(),sizeOfBuffer-indexOffset,canRead,canWrite,handle);
115115
}
116116
else
117117
{
118-
stream=newDataStream(Interop.Fixed(userBuffer),sizeOfBuffer,canRead,canWrite,true);
118+
stream=newDataStream(indexOffset+(byte*)Interop.Fixed(userBuffer),sizeOfBuffer-indexOffset,canRead,canWrite,true);
119119
}
120120

121121
returnstream;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp