@@ -153,12 +153,12 @@ public override int Page(IntPtr handle, IntPtr device, int copies, int flush)
153153
154154 _destImage . Lock ( ) ;
155155
156- IntPtr tempTile = Marshal . AllocCoTaskMem ( _destImage . Stride * _destImage . Height ) ;
156+ IntPtr tempTile = Marshal . AllocHGlobal ( _destImage . Stride * _destImage . Height ) ;
157157
158158 ImageMemoryHelper . CopyImagePartFrom ( _srcImage , tempTile , 0 , 0 , _destImage . Width , _destImage . Height , _srcStride , bytesPerPixel ) ;
159159 ImageMemoryHelper . FlipImageVertically ( tempTile , _destImage . Scan0 , _destImage . Height , _destImage . Stride ) ;
160160
161- Marshal . FreeCoTaskMem ( tempTile ) ;
161+ Marshal . FreeHGlobal ( tempTile ) ;
162162
163163 _destImage . Unlock ( ) ;
164164 }
@@ -206,8 +206,8 @@ public override int Update(IntPtr handle, IntPtr device, int x, int y, int w, in
206206
207207 return 0 ;
208208 }
209-
210- IntPtr tempTile = Marshal . AllocCoTaskMem ( tileStride * h ) ;
209+
210+ IntPtr tempTile = Marshal . AllocHGlobal ( tileStride * h ) ;
211211
212212 ImageMemoryHelper . CopyImagePartFrom ( _srcImage , tempTile , x , y , w , h , _srcStride , bytesPerPixel ) ;
213213
@@ -217,7 +217,7 @@ public override int Update(IntPtr handle, IntPtr device, int x, int y, int w, in
217217
218218 ImageMemoryHelper . CopyImagePartTo ( _destImage . Scan0 , tempTile , x , tileMirrorY , w , h , destStrideSize , bytesPerPixel ) ;
219219
220- Marshal . FreeCoTaskMem ( tempTile ) ;
220+ Marshal . FreeHGlobal ( tempTile ) ;
221221
222222 _destImage . Unlock ( ) ;
223223
0 commit comments