dahall
dabe7bcd84
Added methods to assist with memory alignment.
2020-09-10 10:11:58 -06:00
NN
80bfe2ce20
Call to closeMethod in GenericSafeHandle. ( #161 )
2020-08-27 10:25:14 -06:00
dahall
b7d0a30276
Updated project information
2020-08-26 21:03:04 -06:00
dahall
37d8521a9d
Updated project files for 3.2.14
2020-08-20 09:28:06 -06:00
dahall
c5814672d5
Added protected size and offset values
2020-08-19 20:51:11 -06:00
dahall
c88d9feb3c
Added LibHelper class with Is64BitProcess and DoesWin32MethodExist methods
2020-08-05 10:36:37 -06:00
dahall
cac3df43f2
Project information update
2020-07-27 10:50:28 -06:00
dahall
1564c3d702
Made SafeAllocatedMemoryHandle.GetBytes() public
2020-07-22 18:23:37 -06:00
dahall
091352956e
Fixed ( #152 ) bug in base class SafeMemoryHandleExt that caused ToString(int...) to fail if memory size was not specifically set (like in parameter assignment).
2020-07-20 10:44:01 -06:00
dahall
e701d99c1b
BREAKING CHANGE: Due to performance, changed IMemoryMethods and ISimpleMemoryMethods to contain method signatures instead of properties of method delegates. Then changed all derived memory classes to new interface definition. I believe most of this only affects internal classes so hopefully not a huge effect on your code.
2020-07-20 09:48:32 -06:00
dahall
704987c2a1
Extended all MarshalToPtr methods with lock and unlock pointer functions and optional parameters.
2020-07-19 16:45:54 -06:00
dahall
c081cfa38c
Updated project information files
2020-07-14 16:02:36 -06:00
dahall
fffb6981ff
Update project statistics files
2020-07-14 15:07:18 -06:00
dahall
eb3cc13bb3
Updated project information for 3.2.12
2020-07-13 08:58:32 -06:00
dahall
b3842a902a
Fixed compile warning for unused variable in Convert
2020-07-13 07:56:43 -06:00
David Hall
26f61b9189
Merge pull request #142 from NN---/getiptable_raw
...
Add zero copy GetIpNetTable2.
2020-07-12 08:30:02 -06:00
NN
9e5e73b27c
Throw the exception with stack ( #148 )
2020-07-12 07:55:22 -06:00
NN
ca36a6bc95
Fix passing non-readonly-struct by read-only reference ( #147 )
2020-07-12 07:54:40 -06:00
NN
bc139f52a7
Add zero copy GetIpNetTable2.
2020-07-12 10:09:39 +03:00
dahall
adae5b3268
Fixed bug in UntypedNativeMemoryEnumerator where enumerated type was not set.
2020-07-11 16:25:56 -06:00
dahall
fdcd7e93a1
Updated NuGet packages
2020-06-11 11:52:26 -06:00
dahall
8e981f25b6
Added IsMethodCompatibleWithDelegate method
2020-06-09 19:00:42 -06:00
dahall
28eaf62f3b
Updated project information
2020-06-02 22:02:36 -06:00
dahall
f0976ae924
Added implicit conversion operator to SafeCoTaskMemStruct and SafeHGlobalStruct from nullable struct.
2020-05-27 22:14:24 -06:00
dahall
8b5979d17c
Added SafeCoTaskMemStruct and SafeHGlobalStruct derivations of SafeMemoryStruct
2020-05-26 06:41:40 -06:00
dahall
fb90105165
Added SafeGuidPtr for instances where GUID is optional.
2020-05-20 12:25:55 -06:00
dahall
b309678901
Fixed sizing to include enums
2020-05-20 12:25:19 -06:00
dahall
f67c02dc14
Added SafeAllocatedMemoryHandle.AsReadOnlySpan extension method and changed Span methods to use IntPtr extensions.
2020-05-16 08:56:21 -06:00
dahall
589d47c3b6
Added classes to enumerate on pointer elements (NativeMemoryEnumerator and UntypedNativeMemoryEnumerator). Changed IntPtr.ToIEnum methods to use new classes and added IntPtrGetEnumerator extension methods.
2020-05-15 16:37:15 -06:00
dahall
5c726943b3
Added IntPtr.AsSpan and IntPtr.AsReadOnlySpan extension methods
2020-05-15 11:40:11 -06:00
dahall
30aabcaaed
Added Equals(TStruct) method to SafeMemStruct to prevent boxing when comparing. (Thanks @NN)
2020-05-15 06:46:55 -06:00
dahall
4216d271d9
Added new SafeMemStruct class that wraps a structure into memory with Span support. Added assoc. unit test.
2020-05-14 17:56:28 -06:00
dahall
ab42b87b0c
Moved SafeAllocatedMemoryHandle.Dump back under DEBUG only build. Added AsSpan and AsBytes methods to SafeAllocatedMemoryHandle for frameworks supporting Span<T>. Added SafeMemoryHandleExt.AsRef<T> method for getting a Span of a structure from the memory.
2020-05-14 17:53:35 -06:00
dahall
d1f19d705b
Added System.Memory NuGet package reference for supported frameworks
2020-05-14 17:51:09 -06:00
dahall
a86fe27c11
Updated project file information for 3.2.4 release
2020-04-13 06:44:23 -06:00
dahall
a59b4bfba7
Added ISimpleMemoryMethods (subset of IMemoryMethods with just alloc and free) and MemoryMethodsFromSimple<TSimple> which implements most of IMemoryMethods using just the methods from ISimpleMemoryMethods.
2020-04-07 14:34:28 -06:00
dahall
c0ff453a20
Moved much of the individual project file detail to root Directory.Build.* files for consistency. Fixed build errors due to bad or missing project tags. Cleaned up project files.
2020-04-03 14:51:10 -06:00
dahall
9fdb1ea000
Update project versions to 3.2.4
2020-04-01 18:48:29 -06:00
dahall
1c217e668e
Updated project files to 3.2.3
2020-03-31 18:51:44 -06:00
dahall
814833852b
Major changes which could affect anticipated behavior: All conversions to ordinals now look for max value and will return converted value's max value. No more invalid conversions.
2020-03-31 16:00:36 -06:00
dahall
476960ecbf
Updated project versions to 3.2.2.
2020-03-17 19:48:07 -06:00
dahall
24dc30de5a
Updated project files with v3.2.1 information.
2020-03-09 10:23:37 -06:00
dahall
d8b09ff2ea
Added missing French resources to Vanara.Core
2020-02-29 15:01:18 -07:00
dahall
19b3efd408
Updated project information and version to 3.2.0
2020-02-26 17:35:48 -07:00
dahall
8d10011a6f
Changed call at disposal to just ReleaseComObject insted of FinalReleaseComObject.
2020-02-26 15:15:31 -07:00
dahall
5d711e9580
Removed Core project unfinished files that were excluded.
2020-02-13 10:27:44 -07:00
dahall
c856d06332
Updated project files for v3.1.9
2020-01-17 08:50:25 -07:00
dahall
42677e2063
Project files update for v3.1.8.
2020-01-13 09:26:39 -07:00
dahall
6edf55346d
Added support for .NET Core 3.1
2020-01-03 16:46:48 -07:00
David Hall
08273f800c
Added StringHelper.IsNullOrWhiteSpace to account for missing function prior to .NET 4. ( #86 )
2019-12-30 10:25:45 -07:00
David Hall
1ee34f1001
Updated all project files to version 3.1.7
2019-12-17 15:05:04 -07:00
David Hall
c2c9a6e2e6
Updated project files to support SourceLink
2019-12-17 14:56:55 -07:00
David Hall
61d0fbb908
Updated project files for 3.1.6 release
2019-12-11 22:09:39 -07:00
David Hall
f74d478b28
Added support for serialization to WriteNoChecks
2019-12-10 06:55:54 -07:00
David Hall
ad3e1e06ce
Fixed EnumInheritance
2019-12-10 06:55:20 -07:00
David Hall
c3121e6ecb
Fixed passing byte[] into GetSize
2019-12-10 06:54:55 -07:00
David Hall
89d17b5241
Added ISerializable support as last option for pushing and pulling from memory pointers
2019-12-09 07:22:20 -07:00
David Hall
38baa53cc1
Unfinished work on object marshaler
2019-12-06 17:09:56 -07:00
David Hall
159f1c8235
Added EnumInheritance and InheritsFrom extension methods.
2019-12-06 17:09:08 -07:00
David Hall
2cb4245f37
Added IsMarshalable method and converted most uses of IsBlittable to it. Fixed MarshalToPtr(Array ... method to not throw casting exception.
2019-12-06 17:07:21 -07:00
David Hall
8bb754f22e
Updated project files to version 3.1.5
2019-11-26 08:20:16 -07:00
David Hall
61fe0f30d8
Changed Marshal.SizeOf to InteropExtensions.SizeOf to account for IVanaraMarshaler instances
2019-11-25 19:36:46 -07:00
David Hall
80b7256543
Changed unspecified size to uint.Max instead of UIntPtr.Max to prevent overflow
2019-11-25 19:32:51 -07:00
David Hall
2036104502
Update project information for 3.1.4
2019-11-25 07:02:08 -07:00
David Hall
ce3dc1a0fe
Removed blittable constraint on ToArray and ToEnumerable
2019-11-21 16:33:39 -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
2727b23092
Updated dependent NuGet packages
2019-11-18 09:10:55 -07:00
David Hall
2892d1e677
Added cookie handler to marshaler and attribute
2019-11-16 15:48:44 -07:00
David Hall
79ad7b8452
Added CanGet method to pull when enum is not found
2019-11-16 15:47:02 -07:00
David Hall
2eab8af7eb
Changed project versions to 3.1.4
2019-11-13 23:07:14 -05:00
David Hall
8f289e2760
Changed to support IVanaraMarshaler requiring addition of size parameter to some methods.
2019-11-13 23:02:51 -05:00
David Hall
ba49b74b73
Removed IMarshalDirective and created IVanaraMarshaler with supporting attribute and helper class.
2019-11-13 23:02:11 -05:00
David Hall
035f6ce631
Updated project files for v3.1.3
2019-11-08 08:29:33 -07:00
David Hall
0eb05fc0b0
Updated project info for 3.1.2 release
2019-11-04 06:49:29 -07:00
David Hall
4143c8767e
Added IMarshalDirective interface as a means for IntPtrConverter.Convert to handle odd marshal behavior
2019-11-03 16:00:13 -07:00
David Hall
9ade2c8bd1
Added copy constructor to SafeMemoryHandle and consolidated initialization
2019-10-31 11:47:04 -06:00
David Hall
bb3435550f
Added SafeAllocatedMemoryHandle.TakeOwnership method to take control of the allocated memory.
2019-10-29 10:44:02 -06:00
David Hall
835487e466
Added GetOrderedFields Type extension method.
2019-10-29 10:43:18 -06:00
David Hall
6eee431d3e
Added properties as supportable type for CorrespondingType
2019-10-26 10:22:48 -06:00
David Hall
6ef7235bf3
Update project versions to 3.1.2
2019-10-23 13:44:41 -06:00
David Hall
6fb02a6ad0
Excluded SafeIDispatch until it is working
2019-10-23 13:05:29 -06:00
David Hall
a8e15280e1
Added workaround for missing function in .NET Std 2.0
2019-10-23 12:20:52 -06:00
David Hall
8d21d70f91
Added class to invoke methods on dynamic COM IDispatch.
2019-10-23 12:04:44 -06:00
David Hall
dee8220068
Update project file information and version to 3.1.1.
2019-10-17 13:43:37 -06:00
David Hall
05bd6d2098
Changed Write method to take structure as 'in' param.
2019-10-17 09:13:45 -06:00
David Hall
1b472f58be
Added SizeT.Zero value.
2019-10-17 09:13:00 -06:00
David Hall
77d4e5c49a
Fixed XML doc errors
2019-10-11 10:34:50 -06:00
David Hall
4f087df55c
Added non-generic CanGet/Set methods.
2019-10-08 20:13:17 -06:00
David Hall
cca953eb5f
Fixed bug #66 that forces all SafeMemString string representations to Empty when a size not known (like as a return value from a COM object).
2019-10-08 13:29:30 -06:00
David Hall
bce17ac78f
Added CanSet method that gets the corresponding enum value given a type
2019-10-07 18:43:55 -06:00
David Hall
f517fba76b
Added ObjectSecurity<T> for pre .NET 4.0 builds
2019-10-07 18:43:16 -06:00
David Hall
1a7aaf37f7
Fixed SetField so it works with ref structs
2019-10-07 18:42:49 -06:00
David Hall
4451258143
ADDED: Support for .NET Core 3.0 in all projects!!
...
Updated project files to version 3.1.0, changed icon to embedded NuGet resource rather than link, consolidated dependency conditions in project files, and updated all NuGet dependencies.
2019-10-03 13:35:16 -06:00
David Hall
740bd61ac5
Added ToString method that includes an offset parameter.
2019-09-27 13:32:19 -06:00
David Hall
1450d98b32
Fixed BitPosition logic for exception
2019-09-25 14:12:17 -05:00
David Hall
1491e32f80
Made ISafeMemoryHandle derive from IDisposable
2019-09-19 12:22:21 -06:00
David Hall
c009606359
Added Set method to SafeMemString to allow for a new string to be set on the condition it is of same or lesser length.
2019-09-16 07:55:18 -06:00
David Hall
c0e3335f47
Fixed docs
2019-09-16 07:53:41 -06:00
David Hall
846783b115
Updated project documentation
2019-09-05 21:03:18 -06:00
David Hall
4322becff6
Added better documentation
2019-09-05 19:59:25 -06:00
David Hall
d56d9486e7
Updated project information to version 3.0.1, added DLL references, and updated markdown files.
2019-09-04 14:11:25 -06:00
David Hall
d89a9df2a5
With so many breaking changes, I decided to roll the version to 3.0.0.
2019-08-27 12:42:33 -06:00
David Hall
3a1d6548b3
Added BOOL and BOOLEAN types
2019-08-27 09:05:48 -06:00
David Hall
4a25d8dc25
Added comparison operators and methods
2019-08-27 08:41:39 -06:00
David Hall
15ffe13254
Added ability to get CharSet and resize by setting Capacity property.
2019-08-23 11:52:14 -06:00
David Hall
75a70f2319
Fixed bug due to invalid externs
2019-08-22 13:56:16 -06:00
David Hall
9d4758ed5d
Added Write methods to SafeMemoryHandleExt. Added size checking from InteropExtension methods. Added offset param to ToStructure.
2019-08-21 10:18:07 -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
fb62105f42
Added TypeConverter, MinValue/MaxValue fields, comparison operators, and fixed inconsistent handling of Int32 conversions.
2019-08-17 16:07:02 -06:00
David Hall
246b53dd69
Fixed bug in CanSet method
2019-08-17 16:05:22 -06:00
David Hall
ee72119e36
MAJOR BREAKING CHANGE: Moved all extension methods for System.Object to Vanara.Extensions.Reflection namespace to avoid Intellisense overloads with methods that will be rarely used.
2019-08-17 14:42:49 -06:00
David Hall
a23ac2d587
Fixed bug when handling enums
2019-08-15 00:16:05 -07:00
David Hall
602f847bd8
Fixed bug in CanGet method when value supported more than one type.
2019-08-15 00:15:43 -07:00
David Hall
ae0251ded9
Changed structure input parameter to CreateFromStructure to 'in' for memory classes
2019-07-27 13:05:10 -06:00
David Hall
d72cca74cb
Fixed documentation error
2019-07-27 12:55:59 -06:00
David Hall
683280a945
Updated constructors of all SafeAllocatedMemory derivatives to use SizeT instead of int for the size parameter.
2019-07-27 12:48:33 -06:00
David Hall
42630dd833
BREAKING CHANGE: Changed type of SafeAllocatedMemoryHandle.Size property from int to SizeT so that it more easily converts to different types used in memory size functions.
2019-07-25 19:46:45 -06:00
David Hall
893efef823
Moved into InteropServices
2019-07-25 18:53:21 -06:00
David Hall
9b42ed675c
Moved SizeT into Vanara.Core
2019-07-25 18:51:11 -06:00
David Hall
499f10c996
Changed validation check to ensure boundary is a power of 2.
2019-07-25 12:01:46 -06:00
David Hall
6235cd776e
Added SafeAllocatedMemoryHandle derived class for managed aligned memory buffers.
2019-07-25 10:49:18 -06:00
David Hall
0fef11ebb1
Made SafeMemoryHandle conversion to IntPtr implicit instead of explicit. In practice, I have found this to be a constant conversion need.
2019-07-25 10:48:43 -06:00
David Hall
b471f81899
Fixed bug in new code
2019-07-24 15:23:22 -06:00
David Hall
b4dde29d90
Simplified and extended GetCorrespondingTypes methods
2019-07-24 12:55:23 -06:00
David Hall
277bddcf58
Removed redundant code from CheckHasValue and used IsValid
2019-07-23 13:52:32 -06:00
David Hall
5b4853db7e
Added GetStaticFieldValue method
2019-07-19 17:32:05 -06:00
David Hall
ceff4504f0
Changed to BitHelper broke too much so reverted.
2019-07-16 07:43:10 -06:00
David Hall
6eb0aa354d
Added ToInt64, TimeSpan.ToFileTimeStruct, and ToTimeSpan methods for FILETIME and modified ToString method so that it will display a TimeSpan value if negative.
2019-07-13 21:39:13 -06:00
David Hall
379e23ccb9
Added conversion methods To and ToEnum for fast conversions.
2019-07-13 16:27:46 -06:00
David Hall
64b2911d5e
BREAKING CHANGE: Changed CorrepsondingAction to CorrespondingAction due to misspelling.
2019-07-12 09:49:54 -06:00
David Hall
1996fadd69
Made GetBit and GetBits extension methods
2019-07-10 11:27:04 -06:00
David Hall
025e6529de
Added CreateOrDefault method to get best default value for a structure. Added InvokeStaticMethod to allow for calling a static method generically.
2019-07-09 09:23:41 -06:00
David Hall
63c67871aa
Added DebuggerDisplayAttribute for all classes to show pointer and string values.
2019-07-08 11:37:32 -06:00
David Hall
a360548771
Added Equals override and new GuidPtr structure.
2019-07-03 14:44:16 -06:00
David Hall
c374ab2cff
Added ability to read nullable structure, fixed bug in WriteObject
2019-07-03 14:43:47 -06:00
David Hall
4905441377
Added pointer value in front of string with optional params to remove.
2019-07-03 14:42:51 -06:00
David Hall
7ce7b96209
* Derived SafeCoTaskMemString from base class SafeMemString derived from SafeMemHandle<T>.
...
* BREAKING CHANGE: Removed CharCapacity and made Capacity show char allocation. Size (from parent) shows byte capacity. Mimics StringBuilder.
2019-06-25 17:10:57 -06:00
David Hall
badc08c7e5
Extended StructureToPtr so that it works with `enum` values.
2019-06-17 13:44:46 -06:00
David Hall
ea5e8d6c2b
Consolidated code and fixed bug in ToFileTimeStruct that mixed up UTC conversion.
2019-06-15 13:50:10 -06:00
David Hall
422ab0a7dd
Updated project files for 2.8.11 release
2019-06-07 20:42:41 -06:00
David Hall
3415cac1dc
Added implicit operator from IntPtr
2019-06-07 10:59:03 -06:00
David Hall
1c25f88529
Added Write method to set string into memory
2019-06-07 10:58:30 -06:00
David Hall
d191144a51
Change implicit string conversion to get 'null' for IntPtr.Zero
2019-06-04 16:01:43 -06:00
David Hall
f59831bc2c
Updated project files for 2.3.10
2019-06-04 12:18:56 -06:00
David Hall
0b83c0a914
Updated projects for version 2.3.9
2019-05-25 19:47:54 -06:00
David Hall
da3d9d27b9
Updated project information for 2.3.8
2019-05-13 14:55:44 -06:00
David Hall
cdcdffca4b
Added static Instance field and caused 0's to be trimmed off end of Format response.
2019-05-08 19:02:31 -06:00
David Hall
6627c016f2
Added Get/SetFieldValue extension methods
2019-05-08 12:50:26 -06:00
David Hall
f738792e11
Better null handling
2019-05-08 12:50:01 -06:00
David Hall
1f6d4f4384
Added .NET Stream wrapper for COM IStream instances.
2019-05-08 09:25:15 -06:00