Commit Graph

44 Commits (ee9d5b44103f11f49f7d1ea6a24b7810c19807c9)

Author SHA1 Message Date
David Hall 4a2216f13b Added SafeNativeArray.GetRefAt method to get a reference to an element in the array 2023-01-27 21:12:45 -07:00
David Hall 18cafb3499 Added indexer to `SafeElementArray` 2022-10-12 09:39:43 -06:00
David Hall 6e0d824233 Exposed static fields in `SafeElementArray` 2022-10-12 07:52:36 -06:00
David Hall 79b0342a7d Fixed bug in SafeAnysizeStructBase that couldn't process string arrays. Root cause of #315. 2022-09-16 18:34:22 -06:00
David Hall 2099517c90 Added SafeNativeArrayBase.GetPointers method 2022-09-02 16:33:46 -06:00
dahall fb607a799e Fixed #296 - invalid `MIB_UDP6ROW_OWNER_PID.dwOwningPid` value when calling `GetExtendedUdpTable` 2022-05-04 10:59:33 -06:00
dahall b669932c57 Removed code and conditionals for obsolete target frameworks. 2022-02-07 14:58:09 -07:00
dahall 5f52aa7820 Added SafeMoveableHGlobalHandle class and added support to locking memory to all memory classes. 2022-01-16 17:22:34 -07:00
dahall e886259eef Updated `SafeAnysizeStruct` so an `IntPtr` field can be used for the array size. 2021-09-01 11:05:57 -06:00
dahall 87664c5f97 Added AnySizeStringMarshaler<T> which is an IVanaraMarshaler implementation to handle structures where the last field is a single character string array. Also added ability to use "*" as field name to indicate that string or array length should be determined by the amount of allocated memory. 2021-02-18 14:22:59 -07:00
dahall 3e4e60433e Changed SafeNativeLinkedList back to supporting struct (not unmanaged) type param and removed unsafe pointer getter. 2020-11-11 07:56:03 -07:00
dahall 317947d16b Added SafeNativeLinkedList.GetUnsafeItems 2020-11-10 21:34:45 -07:00
dahall d805e46f28 Derived SafeNativeLinkedList from SafeNativeListBase and added ability to change way linked list is retrieved. 2020-11-10 09:40:46 -07:00
dahall 274953b061 Added SafeNativeListBase which is a SafeMemoryHandle that acts as a read-only list. 2020-11-10 09:39:55 -07:00
dahall 514e974703 Modified GenericStringMarshaler type constraint to ISimpleMemoryMethods 2020-04-11 16:10:33 -06:00
dahall cd46adfb6b Added GenericStringMarshalerBase and GenericStringMarshaler as custom string marshalers that can be typed against an IMemoryMethods implementation. The converted LocalStringMarshaler and CoTaskMemStringMarshaler to use that new class. 2020-04-07 12:43:44 -06:00
dahall 3cf49c0749 Introduced base class for SafeAnysizeStruct to enable reuse with objects that don't use a single field to determine the length of the array. 2020-04-07 09:34:13 -06:00
dahall 2e9935667a Removed generic constraint so classes could be processed and changed ctor param from int to SizeT for consistency with base class. 2020-03-31 16:01:47 -06:00
dahall cc7170875f Fix and test for #101 - Bug when using SafeAnysizeStruct. 2020-01-17 07:54:15 -07:00
David Hall 8ca39f3530 On IntPtr constructor, removed copying of memory from orig pointer and now just use unowned pointer. 2019-11-27 14:45:38 -07:00
David Hall a94e60820b Reworked memory manipulation functions in InteropExtensions and IntPtrConverter to use new marshaling directives and to drive consistency of use across libs (i.e. call same method to do same work). 2019-11-19 12:52:44 -07:00
David Hall 9d02afc6e1 Added SafeAnysizeStructMarshaler which is a IVanaraMarshaler implementation for SafeAnysizeStruct<T> 2019-11-16 15:50:23 -07:00
David Hall 296a559eda Added SafeAnysizeStruct to help marshal stuctures with a 1-element field at the end that can be variable size. Adjusted all structs of this type to use this to marshal along with tests and supported classes.
BREAKING CHANGE: This forced the removal of PTOKEN_PRIVILEGES as that functionality is now in a shared marshaling class.
2019-11-03 16:02:54 -07:00
David Hall cd0819e08b Added headerSize to constructors' parameters from base 2019-09-30 20:36:28 -06:00
David Hall 6db3256757 Added custom marshaler for arrays of string pointers 2019-09-16 07:57:52 -06:00
David Hall c532e6061f Made indexer related properties virtual 2019-08-22 13:57:03 -06:00
David Hall c3521b7742 MAJOR BREAKING CHANGEs:
1) Obsoleted Vanara.Extensions.InteropExtensions.StructureToPtr for a name change to MarshalToPtr for consistency.
2) Added parameter to all methods reading memory that allows developer to indicate size of allocated memory they read from.
3) Enabled the ability to read/write enum values from memory in all extension methods.
4) Added Write methods for writing to memory
2019-08-17 21:13:57 -06:00
David Hall ffed6e252a Added constructor to allow for ReadOnly use. 2019-07-03 14:45:15 -06:00
David Hall 2c1b24e3e1 Fixed bug in Insert 2019-06-09 10:00:16 -06:00
David Hall 8d211da1de Fixed bugs on Insert and array set methods 2019-05-09 15:56:31 -06:00
David Hall f5ad3f0755 Extracted SafeNativeArrayBase from SafeNativeArray that allows for a different memory manager to be used and enhances/fixes the ability to insert a header before the array. 2019-05-08 09:30:06 -06:00
David Hall 348fc7b7f7 Added class to handle linked list of native structures in memory 2019-04-24 08:28:18 -06:00
David Hall 0383068abe Added documentation and protected constructor to allocate just raw memory 2019-04-24 08:27:31 -06:00
David Hall 8770bc4bae Updated documentation, added mem-zeroing on array set 2019-04-24 08:26:50 -06:00
David Hall 3a56122887 Updated documentation 2019-04-17 12:51:11 -06:00
David Hall 5597d959c2 Updated documentation 2019-04-17 12:25:05 -06:00
David Hall 8a1355b0af Updated comments 2018-11-28 12:33:55 -07:00
David Hall c5467dfb7e Another 2.0 major commit. All tests working. 2018-11-19 21:18:50 -07:00
David Hall 627c6d2314 2.0 Checkin - Buildable 2018-10-26 12:24:07 -06:00
David Hall 0d8b96fe9b Corrected XML documentation errors 2018-04-03 18:35:18 -06:00
David Hall e6910dc9a9 Fixed bug with CoTaskMemStringMarshaler being used for return values and is never called. Added marshaler to places where appropriate. 2018-01-15 09:41:05 -07:00
David Hall 9f2d1c1c60 Added SafeElementArray class to Core to handle BLOB types 2018-01-06 16:37:05 -07:00
David Hall d33fa43e7b Minor cleaning and reorganizing 2017-11-28 09:00:10 -07:00
David Hall b44f91b5a1 Initial code push: Core, PInvoke.Shared and PInvoke.TaskSchd 2017-11-27 10:18:01 -07:00