- usb_encdec.zip
- USB EncDec
- Code Project Open License
- DD
- DD
- checked_lib
- i386
- EDDrv.lib
- EDDrv.C
- EDDrv.H
- EDDrv.lib
- EDDrvLib.h
- IOCTLCMD.H
- MAKEFILE
- objchk_wxp_x86
- _objects.mac
- i386
- eddrv.obj
- release_eddrv
- release_lib
- i386
- EDDrv.lib
- SOURCES
- Readme.txt
- USB Controller
- USBController
- installation.zip
- Installation
|
#ifndef _USBCNTLSDMGR_H /* not _USBCNTLSDMGR_H */
#define _USBCNTLSDMGR_H
//--------------------------------------------------------------------
// Include
#include <windows.h>
#include <tchar.h>
#include <string>
#include <winspool.h>
using namespace std;
//! System user-name
#define USBCNTL_SYSTEM_USER L"system"
//! Everyone user-name
#define USBCNTL_EVERY_USER L"Everyone"
//! Size of domain name buffer
#define SD_BUFSIZE_DOMAINNAME 1024
//! Succession right used when management authority of document of printer is given
#define PRINTER_INHERIT (OBJECT_INHERIT_ACE | INHERIT_ONLY_ACE)
// Kind of right of access
typedef struct {
DWORD All;
DWORD Write;
DWORD Read;
} USBCNTL_RSRC_ACCESSMASK;
/*@
@class CUSBCntlSdMgr
@brief Security descriptor control class
@variable +SECURITY_ATTRIBUTES m_SecAttr :SECURITY_ATTRIBUTES structure
@variable #PSECURITY_DESCRIPTOR m_pSecDesc :Pointer of security descriptor
@variable #PSID m_pSid :Pointer of SID
@variable #PSID m_pSidSystemUser :Pointer of system user SID
@variable #PSID m_pSidEveryUser :Pointer of EveryOne user SID
@variable #PACL m_pAcl :Pointer to access control list
@*/
class CUSBCntlSdMgr
{
public:
CUSBCntlSdMgr(void);
~CUSBCntlSdMgr(void);
protected:
//public:
PSECURITY_DESCRIPTOR m_pSecDesc;
PSID m_pSid;
PSID m_pSidSystemUser;
PSID m_pSidEveryUser;
PACL m_pAcl;
public:
typedef enum tag_USBCNTL_RESOURCE_ID {
driFile = 0,
driEvent,
driMutex,
driReg,
driShMem,
driPrinter,
driMax
};
SECURITY_ATTRIBUTES m_SecAttr;
// Initialization
BOOL InitSecDesc(void);
// Close of resource
BOOL Close(void);
// Everyone full access
BOOL GenerateSdOfEveryoneFullAccess(DWORD dwRsrcId);
// Only Admin full access
BOOL GenerateSdOfOnlyAdminAccess(DWORD dwRsrcId);
// Only the reference Admin full accesses Everyone.
BOOL GenerateSdOfEveryoneReadOnly(DWORD dwRsrcId);
// EVeryone and Admin full access
BOOL GenerateSdOfSystemAndEveryoneFullAccess(DWORD dwRsrcId);
// Only System full is accessed.
BOOL GenerateSdOfSystemFullAccess(DWORD dwRsrcId);
// One user's SID is acquired.
BOOL GetSid(PWCHAR pwszUserName, PSID& pSid);
// One user's SECURITY_DESCRIPTOR is made.
BOOL GetSecdesc(PWCHAR pwszUserName, DWORD dwAccessMask);
};
#endif /* end _USBCNTLSDMGR_H */
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.