Commit Graph

163 Commits (7c032ba708e713ba65ec96e544d9226bc487e97d)

Author SHA1 Message Date
David Hall f196cb9baf Improved object disposal in SafeHTOKEN.FromThread 2019-11-03 21:28:34 -07:00
David Hall 803b31f094 Added SID_AND_ATTRIBUTES.ToString 2019-11-03 21:27:51 -07:00
David Hall 6669249944 Added error handling to PSID.ToString("D") 2019-11-03 21:27:26 -07:00
David Hall 4beb2c77bc Fixed unterminated string bug in LSA_UNICODE_STRING.ToString and implicit operator. 2019-11-03 21:26:43 -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 da3fad8c40 Moved URLZONE enum up to to Pinvoke/Shared assembly 2019-09-16 07:56:00 -06:00
David Hall 763407f6f7 Completed unit tests and changes for winsvc.h functions 2019-08-27 08:25:35 -06:00
David Hall fa274e0d61 Completed unit tests and updates for winsafer.h functions 2019-08-26 15:08:09 -06:00
David Hall 61637818d6 Finished unit testing and corrections for winreg.h functions 2019-08-26 13:08:42 -06:00
David Hall 50a8a10a54 Cleaned and reorganized 2019-08-23 14:38:53 -06:00
David Hall 6065013993 Completed unit tests and updates for winefs.h functions. 2019-08-23 14:05:09 -06:00
David Hall 196e02e1f4 Completed unit testing and fixes for wincred.h functions 2019-08-21 13:09:39 -06:00
David Hall d03c88b931 Added SafePEVENTLOGRECORD to make it easier to deal with some very C centric handling of field values. 2019-08-20 15:58:52 -06:00
David Hall 727021fea8 Added event log unit tests and fixes for winbase.h functions. 2019-08-20 10:20:45 -06:00
David Hall 2af1e65730 Completed unit tests for winbase.h along with API changes. 2019-08-19 15:08:58 -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 692524a94a Fixed NotifyServiceStatusChange code and unit test 2019-08-17 19:26:09 -06:00
David Hall 92ad7b8abe Competed unit tests and fixes for wct.h functions and structures 2019-08-15 16:32:57 -07:00
David Hall 38ab24c904 Completed unit tests and updates to SID functions in SecurityBaseApi.h 2019-08-15 15:36:12 -07:00
David Hall 871ad3b8ce Whew! Lots of work and significant changes coming from completing unit testing and corresponding fixes and additions for SecurityBaseApi.h and WinNT.h. 2019-08-15 10:08:41 -07:00
David Hall 18b02b1c77 Added DebuggerDisplay attribute and property. Added factory method to create known capability SID. Added PSID extension methods to mimic some found in SafePSID. 2019-08-15 00:20:08 -07:00
David Hall fd5fb45297 Added improved parameter attributes 2019-08-15 00:18:11 -07:00
David Hall cba9506edc Completed unit testings and updates for sddl.h functions and wrappers 2019-08-12 09:57:07 -06:00
David Hall 0c798f899f Completed unit testing and fixes for SafePSID and SafePSIDArray 2019-08-12 09:04:53 -06:00
David Hall 0626a21e17 Complete unit tests and changes for perflib.h 2019-08-11 15:28:41 -06:00
David Hall 29c8cc70a2 Cleaned up comments and enum types 2019-08-10 14:11:50 -06:00
David Hall 7a0acde552 Finished unit testing and updates for ntsecapi.h audit functions 2019-08-10 13:51:36 -06:00
David Hall 0c73576e40 Collapsed SafeLocalPSID into SafePSID. Enhanced SafePSIDArray.
Finished unit testing and changes for Lsa** functions.
2019-08-09 14:18:18 -06:00
David Hall 198a3fafd5 Completed unit testing and fixes for trace event functions. 2019-08-08 14:46:52 -06:00
David Hall 0ab573c245 Completed unit tests and updates for evntprov.h 2019-08-04 16:58:42 -06:00
David Hall c09b2ec246 Completed unit testing and fixes for aclapi.h functions 2019-08-02 13:42:47 -06:00
David Hall 1fe23556ac For null terminated string arrays, used custom marshaler to simplify input parameters. 2019-07-31 20:03:19 -06:00
David Hall 3f68b4f114 Renamed ControlCallback to TraceControlCallback to avoid naming conflict with delegate in perflib.h 2019-07-25 20:37:25 -06:00
David Hall fa9ba9ff74 Changed names of delegates where existing ALLCAP name was a reference to another name. Could be a breaking change. 2019-07-25 20:25:24 -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 115f7b08d8 Completed unit tests and fixes for namedpipeapi.h including introduction of HPIPE and SafeHPIPE for pipe handles. 2019-07-23 19:36:59 -06:00
David Hall f9f7068a9d BREAKING CHANGE: Moved SecurityBaseApi.h functions to PInvoke.Security even though they live in Kernel32. Simplifies structure access and Security depends on Kernel32 anyway. 2019-07-12 16:57:28 -06:00
David Hall a2088da9aa Added SafePACL and CLAIM_SECURITY_ATTRIBUTES* structures 2019-07-12 13:45:36 -06:00
David Hall 8c0069a1a4 Fixed params on GetAclInformation 2019-07-12 13:44:42 -06:00
David Hall 0ca6f73c23 Added Everyone static field to SafePSID 2019-07-12 13:44:14 -06:00
David Hall 2f5ca286f5 Added BuildSecurityDescriptor overload for NULL values 2019-07-12 13:43:44 -06:00
David Hall 64b2911d5e BREAKING CHANGE: Changed CorrepsondingAction to CorrespondingAction due to misspelling. 2019-07-12 09:49:54 -06:00
David Hall 3df4a4af97 BREAKING CHANGE: Renamed SafeSECURITY_DESCRIPTOR to SafePrivateObjectSecurity and SafeSecurityDescriptor to SafePSECURITY_DESCRIPTOR due to inconsistency in framework leading to numerous misuse instances. Sorry! 2019-07-12 09:47:46 -06:00
David Hall b78deacf02 Added CreateProcessAsUser with STARTUPINFOEX param 2019-06-26 17:49:08 -06:00
David Hall 0920c029ec Added MandatoryIntegrityLevelSIDRelativeID 2019-06-25 17:19:55 -06:00
David Hall fe11d25a59 Fixed FreeSid declaration 2019-06-25 17:19:33 -06:00
David Hall 0b3d8ba147 Added AdjustTokenPrivileges variations 2019-06-25 17:19:10 -06:00
David Hall 34ce5635ff Added constructor from SecurityIdentifier and Current property to SafePSID. 2019-06-25 17:11:42 -06:00
David Hall cd71160495 Corrected bug in AdjustTokenPrivileges and dependent code 2019-06-19 14:44:05 -06:00
David Hall 64d6a2f4f7 BREAKING CHANGE: Fixed #57 and all other CreateProcessXX references. Changed managed PROCESS_INFORMATION to SafePROCESS_INFORMATION and exposed native PROCESS_INFORMATION. If you were using PROCESS_INFORMATION before, please check it's use. It has changed now to SafePROCESS_INFORMATION. 2019-06-15 13:48:50 -06:00
David Hall c254e5e62d Added constructor to SID_AND_ATTRIBUTES 2019-06-09 10:00:03 -06:00
David Hall da8b40b1b9 Corrected more blittability problems 2019-06-07 11:51:47 -06:00
David Hall 68775cdb5b Fixed overlap issue with WAITCHAIN_NODE_INFO 2019-06-07 11:04:53 -06:00
David Hall 10b3aee029 Fixed comments, moved ToString content to DebuggerDisplay attribute where more apprpriate., corrected overlap and blittability problems with structures, add SafeLSA_UNICODE_STRING claass to deal with mem allocations. 2019-06-07 11:04:18 -06:00
David Hall 4b2ad79ab1 Added implicit conversion from PSID to SafePSID which copies the underlying content 2019-06-07 11:01:44 -06:00
David Hall b8564c6984 Fixed overlap problems with INSTALLSPEC 2019-06-07 11:01:03 -06:00
David Hall 138412c3a4 Fixed problem with CREDENTIAL layout, added managed equivalent and fixed CredEnum #54 2019-06-04 16:01:09 -06:00
David Hall 5ee2b906b7 Completed work on AdvApi32 2019-06-04 12:16:41 -06:00
David Hall c8cb9a29d7 Completed work on Wait Chains (wct.h) 2019-05-30 19:07:04 -06:00
David Hall ca8fcb7bf5 Added remainder of AdvApi32 Windows service management functions and provided .NET native security access functions and classes. 2019-05-30 13:37:31 -06:00
David Hall 9ca4cf1720 Added winefs.h functions 2019-05-27 19:40:40 -06:00
David Hall 58716021f7 Added Audit functions 2019-05-27 19:40:21 -06:00
David Hall f046f68ad2 Added SafePSID.CreateWellKnown factory method 2019-05-27 19:39:40 -06:00
David Hall dfda94ba24 Separated Audit functions into separate file 2019-05-27 19:39:00 -06:00
David Hall c801a5137a Added SafePACL 2019-05-27 19:38:27 -06:00
David Hall ddf0c5f0a6 Changed UInt32 to ACCESS_MASK where appropriate 2019-05-27 19:37:44 -06:00
David Hall 49b489d4be Cleaned up code on marshalers 2019-05-13 14:43:03 -06:00
David Hall d69470a78a Added partially documented LogonUserExExW 2019-05-09 17:42:36 -06:00
David Hall 136340947c Fixed sizing of LSA_UNICODE_STRING 2019-05-08 09:30:53 -06:00
David Hall 769d045df2 More security additions (advapi32, secur32) 2019-04-30 07:59:38 -06:00
David Hall 539f56d373 Untested: Complete translation of all Authz and Secur32 functions and structs 2019-04-25 14:40:23 -06:00
David Hall 7164c624b1 Added missing using statement 2019-04-10 13:10:35 -06:00
David Hall 124549d3f5 Added many new AdvApi32 methods 2019-04-10 12:13:59 -06:00
David Hall d007f1babd Lots of work on ACE handling 2019-04-09 11:46:44 -06:00
David Hall a1837a70f5 Added ACCESS_ALLOWED_ACE.GetSid method to extract SafeSID value from structure. Added event structures. Made marshaler for PRIVILEGE_SET safer. Many additions to SafeSecurityDescriptor. 2019-04-08 11:38:00 -06:00
David Hall 9eea42368b Added functions: AccessCheck, AccessCheckByType, AccessCheckByTypeResultList, GetSecurityDescriptorGroup, GetSecurityDescriptorLength, GetSecurityDescriptorSacl, IsValidSecurityDescriptor. Provided helper overloads for GetAclInformation, GetPrivateObjectSecurity. Enhanced SafeHTOKEN class. 2019-04-08 11:35:40 -06:00
David Hall da6113c621 Cleaned up comments 2019-04-08 11:27:09 -06:00
David Hall b8fe8bdf89 Moved GetInheritanceSource helper to PInvoke project 2019-03-16 16:12:25 -06:00
David Hall ffb7879e3f Added AdvApi32 event log methods 2019-03-13 09:58:00 -06:00
David Hall 8a8b265834 ToString methods added to LsaForest structures 2019-02-18 14:28:34 -07:00
David Hall 20adde08ae Added LsaForestTrustInformation.FromBuffer static method to create a new instance from a pointer. 2019-02-16 18:17:18 -07:00
David Hall e99a0eff51 Major rework of LSA_FOREST_TRUST_INFORMATION by supplying a helper class (LsaForestTrustInformation) that makes the creation of it very .NET happy. Simply fill out the class with entries you need and then call DangerousGetLSA_FOREST_TRUST_INFORMATION() to build the structure. Also improved comments as I found more detail. 2019-02-16 17:40:12 -07:00
David Hall 4ce874c5c0 Tweaked work submitted by @gigi81 to match project style, reorganize files, and update documentation. 2019-02-11 19:34:47 -07:00
David Hall 8aefdc9389 Revert "Added some missing functions, structs and enums to winsvc.cs and tests"
This reverts commit dd15c0478c.
2019-02-11 18:38:41 -07:00
David Hall 1364d3a447
Merge pull request #38 from gigi81/feature/advapi32-winsvc
Added some missing functions, structs and enums to winsvc.cs and tests
2019-02-11 18:31:51 -07:00
Luigi Grilli dd15c0478c Added some missing functions, structs and enums to winsvc.cs and tests
Added QueryServiceStatusEx SERVICE_STATUS_PROCESS and more and test

Removed redundant CloseServiceHandle calls

Added Start/Stop/Delete/Control service functions

Added Start/Stop/Delete/Control service functions and appveyor for testing

Fixed version in appveyor.yml

Reducing msbuild verbosity

Improved AdvApi32 tests

Improve StartStop test method

Fixed StartService arguments types

Added ControlService, Fixed ControlServiceEx

Delete appveyor.yml
2019-02-07 00:52:59 +00:00
David Hall f1085cd3a5 Change SafeHandle derived base class HANDLE to SafeHANDLE. Yes, bonehead move to not do this correctly from the beginning. 2019-02-04 09:51:08 -07:00
David Hall c846af84e5 Added more RegSet overloads 2019-01-17 21:02:28 -08:00
David Hall 635c8d8a33 Added overloads for RegSet* functions 2019-01-17 19:46:32 -08:00
David Hall fd06ac5e0a Moved REG_VALUE_TYPE enum from AdvApi32 to Shared 2019-01-16 08:07:46 -07:00
David Hall eb902e4595 Fixed build errors and warnings due to XML comments and obsolete license reference in project files. 2018-12-15 13:44:33 -07: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 138accc380 MAJOR BREAKING CHANGES: Fundamentally changed how HANDLEs are represented and used. Much better type safety now that all handles derive from HANDLE and disposing instances are all noted by a SafeHxxx name. Solves problem with circular references and random IntPtr parameters. 2018-09-21 22:35:34 -06:00
David Hall 1f54ff7c9c Added ImpersonateLoggedOnUser. 2018-09-05 07:31:39 -06:00
David Hall fc3ebba322 Replaced numerous IntPtr calls to SafeSecurityDescriptor. 2018-09-04 13:43:41 -06:00
David Hall d219c93e7f Major rework to ConvertSecurityDescriptorToStringSecurityDescriptor and ConvertStringSecurityDescriptorToSecurityDescriptor to include SafeHandles and automatic marshaling. 2018-09-04 12:09:56 -06:00
David Hall 6b1ed53536 Made conversion operator from GenericSafeHandle to IntPtr explicit to minimize unintended conversions (#12) and updated all affected functions, including fixing those affected by unintended consequences. 2018-09-04 12:04:25 -06:00
David Hall 6fafeaf0b9 Adding 2 byte packing to LSA_UNICODE_STRING 2018-08-30 16:06:36 -06:00