nusec: add NUSEC_IOCTL_TD_ERASE_USED

This commit is contained in:
Hay1tsme 2024-03-12 13:55:57 -04:00
parent eb93c6cf75
commit 67ffde7289

View File

@ -14,21 +14,22 @@
#include "util/str.h" #include "util/str.h"
enum { enum {
NUSEC_IOCTL_PING = 0x22A114, NUSEC_IOCTL_PING = CTL_CODE(0x22, 0x845, METHOD_BUFFERED, FILE_WRITE_ACCESS),
NUSEC_IOCTL_ERASE_TRACE_LOG = 0x22E188, NUSEC_IOCTL_GET_PLAY_COUNT = CTL_CODE(0x22, 0x854, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_ADD_PLAY_COUNT = 0x22E154, NUSEC_IOCTL_ADD_PLAY_COUNT = CTL_CODE(0x22, 0x855, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_BILLING_CA_CERT = 0x22E1C4, NUSEC_IOCTL_ERASE_TRACE_LOG = CTL_CODE(0x22, 0x862, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_BILLING_PUBKEY = 0x22E1C8, NUSEC_IOCTL_TD_ERASE_USED = CTL_CODE(0x22, 0x863, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_NEARFULL = 0x22E20C, NUSEC_IOCTL_PUT_TRACE_LOG_DATA = CTL_CODE(0x22, 0x864, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_NVRAM_AVAILABLE = 0x22E19C, NUSEC_IOCTL_GET_TRACE_LOG_DATA = CTL_CODE(0x22, 0x865, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_NVRAM_GEOMETRY = 0x22E24C, NUSEC_IOCTL_GET_TRACE_LOG_STATE = CTL_CODE(0x22, 0x866, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_PLAY_COUNT = 0x22E150, NUSEC_IOCTL_GET_NVRAM_AVAILABLE = CTL_CODE(0x22, 0x867, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_PLAY_LIMIT = 0x22E204, NUSEC_IOCTL_GET_BILLING_CA_CERT = CTL_CODE(0x22, 0x871, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_TRACE_LOG_DATA = 0x22E194, NUSEC_IOCTL_GET_BILLING_PUBKEY = CTL_CODE(0x22, 0x872, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_TRACE_LOG_STATE = 0x22E198, NUSEC_IOCTL_GET_PLAY_LIMIT = CTL_CODE(0x22, 0x881, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_PUT_NEARFULL = 0x22E210, NUSEC_IOCTL_PUT_PLAY_LIMIT = CTL_CODE(0x22, 0x882, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_PUT_PLAY_LIMIT = 0x22E208, NUSEC_IOCTL_GET_NEARFULL = CTL_CODE(0x22, 0x883, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_PUT_TRACE_LOG_DATA = 0x22E190, NUSEC_IOCTL_PUT_NEARFULL = CTL_CODE(0x22, 0x884, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
NUSEC_IOCTL_GET_NVRAM_GEOMETRY = CTL_CODE(0x22, 0x893, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS),
}; };
struct nusec_log_record { struct nusec_log_record {
@ -42,6 +43,7 @@ static HRESULT nusec_handle_ioctl(struct irp *irp);
static HRESULT nusec_ioctl_ping(struct irp *irp); static HRESULT nusec_ioctl_ping(struct irp *irp);
static HRESULT nusec_ioctl_erase_trace_log(struct irp *irp); static HRESULT nusec_ioctl_erase_trace_log(struct irp *irp);
static HRESULT nusec_ioctl_td_erase_used(struct irp *irp);
static HRESULT nusec_ioctl_add_play_count(struct irp *irp); static HRESULT nusec_ioctl_add_play_count(struct irp *irp);
static HRESULT nusec_ioctl_get_billing_ca_cert(struct irp *irp); static HRESULT nusec_ioctl_get_billing_ca_cert(struct irp *irp);
static HRESULT nusec_ioctl_get_billing_pubkey(struct irp *irp); static HRESULT nusec_ioctl_get_billing_pubkey(struct irp *irp);
@ -209,6 +211,9 @@ static HRESULT nusec_handle_ioctl(struct irp *irp)
case NUSEC_IOCTL_ERASE_TRACE_LOG: case NUSEC_IOCTL_ERASE_TRACE_LOG:
return nusec_ioctl_erase_trace_log(irp); return nusec_ioctl_erase_trace_log(irp);
case NUSEC_IOCTL_TD_ERASE_USED:
return nusec_ioctl_td_erase_used(irp);
case NUSEC_IOCTL_ADD_PLAY_COUNT: case NUSEC_IOCTL_ADD_PLAY_COUNT:
return nusec_ioctl_add_play_count(irp); return nusec_ioctl_add_play_count(irp);
@ -288,6 +293,13 @@ static HRESULT nusec_ioctl_erase_trace_log(struct irp *irp)
return S_OK; return S_OK;
} }
static HRESULT nusec_ioctl_td_erase_used(struct irp *irp)
{
dprintf("Security: %s\n", __func__);
return S_OK;
}
static HRESULT nusec_ioctl_add_play_count(struct irp *irp) static HRESULT nusec_ioctl_add_play_count(struct irp *irp)
{ {
uint32_t delta; uint32_t delta;