}
static bool reg_hive_key(TALLOC_CTX *ctx, const char *fullname,
- uint32 *reg_type, const char **key_name)
+ uint32_t *reg_type, const char **key_name)
{
WERROR werr;
char *hivename = NULL;
static NTSTATUS registry_openkey(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *pipe_hnd,
- const char *name, uint32 access_mask,
+ const char *name, uint32_t access_mask,
struct policy_handle *hive_hnd,
struct policy_handle *key_hnd)
{
- uint32 hive;
+ uint32_t hive;
NTSTATUS status;
WERROR werr;
struct winreg_String key;
static NTSTATUS registry_enumkeys(TALLOC_CTX *ctx,
struct rpc_pipe_client *pipe_hnd,
struct policy_handle *key_hnd,
- uint32 *pnum_keys, char ***pnames,
+ uint32_t *pnum_keys, char ***pnames,
char ***pclasses, NTTIME ***pmodtimes)
{
TALLOC_CTX *mem_ctx;
NTSTATUS status;
WERROR werr;
- uint32 num_subkeys, max_subkeylen, max_classlen;
- uint32 num_values, max_valnamelen, max_valbufsize;
- uint32 i;
+ uint32_t num_subkeys, max_subkeylen, max_classlen;
+ uint32_t num_values, max_valnamelen, max_valbufsize;
+ uint32_t i;
NTTIME last_changed_time;
- uint32 secdescsize;
+ uint32_t secdescsize;
struct winreg_String classname;
char **names, **classes;
NTTIME **modtimes;
static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx,
struct rpc_pipe_client *pipe_hnd,
struct policy_handle *key_hnd,
- uint32 *pnum_values, char ***pvalnames,
+ uint32_t *pnum_values, char ***pvalnames,
struct registry_value ***pvalues)
{
TALLOC_CTX *mem_ctx;
NTSTATUS status;
WERROR werr;
- uint32 num_subkeys, max_subkeylen, max_classlen;
- uint32 num_values, max_valnamelen, max_valbufsize;
- uint32 i;
+ uint32_t num_subkeys, max_subkeylen, max_classlen;
+ uint32_t num_values, max_valnamelen, max_valbufsize;
+ uint32_t i;
NTTIME last_changed_time;
- uint32 secdescsize;
+ uint32_t secdescsize;
struct winreg_String classname;
struct registry_value **values;
char **names;
for (i=0; i<num_values; i++) {
enum winreg_Type type = REG_NONE;
- uint8 *data = NULL;
- uint32 data_size;
- uint32 value_length;
+ uint8_t *data = NULL;
+ uint32_t data_size;
+ uint32_t value_length;
char n;
struct winreg_ValNameBuf name_buf;
name_buf.size = max_valnamelen + 2;
data_size = max_valbufsize;
- data = (uint8 *)TALLOC(mem_ctx, data_size);
+ data = (uint8_t *)TALLOC(mem_ctx, data_size);
value_length = 0;
status = dcerpc_winreg_EnumValue(b, mem_ctx, key_hnd,
static NTSTATUS registry_enumvalues2(TALLOC_CTX *ctx,
struct rpc_pipe_client *pipe_hnd,
struct policy_handle *key_hnd,
- uint32 *pnum_values, char ***pvalnames,
+ uint32_t *pnum_values, char ***pvalnames,
struct regval_blob ***pvalues)
{
TALLOC_CTX *mem_ctx;
NTSTATUS status;
WERROR werr;
- uint32 num_subkeys, max_subkeylen, max_classlen;
- uint32 num_values, max_valnamelen, max_valbufsize;
- uint32 i;
+ uint32_t num_subkeys, max_subkeylen, max_classlen;
+ uint32_t num_values, max_valnamelen, max_valbufsize;
+ uint32_t i;
NTTIME last_changed_time;
- uint32 secdescsize;
+ uint32_t secdescsize;
struct winreg_String classname;
struct regval_blob **values;
char **names;
for (i=0; i<num_values; i++) {
enum winreg_Type type = REG_NONE;
- uint8 *data = NULL;
- uint32 data_size;
- uint32 value_length;
+ uint8_t *data = NULL;
+ uint32_t data_size;
+ uint32_t value_length;
char n;
struct winreg_ValNameBuf name_buf;
name_buf.size = max_valnamelen + 2;
data_size = max_valbufsize;
- data = (uint8 *)TALLOC(mem_ctx, data_size);
+ data = (uint8_t *)TALLOC(mem_ctx, data_size);
value_length = 0;
status = dcerpc_winreg_EnumValue(b, mem_ctx, key_hnd,
}
if (strequal(argv[2], "dword")) {
- uint32_t v = strtoul(argv[3], NULL, 10);
+ int error = 0;
+ uint32_t v;
+
+ v = smb_strtoul(argv[3], NULL, 10, &error, SMB_STR_STANDARD);
+ if (error != 0) {
+ goto error;
+ }
+
value.type = REG_DWORD;
value.data = data_blob_talloc(mem_ctx, NULL, 4);
SIVAL(value.data.data, 0, v);
int argc,
const char **argv )
{
- uint32 hive;
+ uint32_t hive;
struct policy_handle hive_hnd, key_hnd;
struct winreg_String key, keyclass;
enum winreg_CreateAction action;
int argc,
const char **argv )
{
- uint32 hive;
+ uint32_t hive;
struct policy_handle hive_hnd;
struct winreg_String key;
NTSTATUS status;
struct policy_handle pol_hive, pol_key;
NTSTATUS status;
WERROR werr;
- uint32 num_subkeys = 0;
- uint32 num_values = 0;
+ uint32_t num_subkeys = 0;
+ uint32_t num_values = 0;
char **names = NULL, **classes = NULL;
NTTIME **modtimes = NULL;
- uint32 i;
+ uint32_t i;
struct registry_value **values = NULL;
struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
int argc,
const char **argv )
{
- WERROR result = WERR_GENERAL_FAILURE;
+ WERROR result = WERR_GEN_FAILURE;
struct policy_handle pol_hive, pol_key;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
struct winreg_String filename;
{
int i, j;
const char *data_str = NULL;
- uint32 data_size, data;
+ uint32_t data_size, data;
DATA_BLOB blob;
if ( !nk->values )
switch ( nk->values[i].type ) {
case REG_SZ:
blob = data_blob_const(nk->values[i].data, data_size);
- pull_reg_sz(talloc_tos(), &blob, &data_str);
+ if (!pull_reg_sz(talloc_tos(), &blob,
+ &data_str)) {
+ data_str = NULL;
+ }
if (!data_str) {
break;
}
const char* name)
{
NTSTATUS status;
- uint32 num_subkeys = 0;
- uint32 num_values = 0;
+ uint32_t num_subkeys = 0;
+ uint32_t num_values = 0;
char **names = NULL, **classes = NULL;
NTTIME **modtimes = NULL;
struct regval_blob **values = NULL;
- uint32 i;
+ uint32_t i;
struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
TALLOC_CTX* mem_ctx = talloc_new(ctx);
keyname.name = name;
if (parent == NULL) {
- uint32 hive_idx = 0;
+ uint32_t hive_idx = 0;
if (!reg_hive_key(mem_ctx, name, &hive_idx, &keyname.name)) {
werr = WERR_FOOBAR;
goto done;
key = talloc_zero(mem_ctx, struct policy_handle);
if (key == NULL) {
- werr = WERR_NOMEM;
+ werr = WERR_NOT_ENOUGH_MEMORY;
goto done;
}
keyname.name = name;
if (parent == NULL) {
- uint32 hive_idx;
+ uint32_t hive_idx;
if (!reg_hive_key(mem_ctx, name, &hive_idx, &keyname.name)) {
werr = WERR_FOOBAR;
goto done;
goto done;
}
- werr = (talloc_free(key) == 0) ? WERR_OK : WERR_GENERAL_FAILURE;
+ werr = (talloc_free(key) == 0) ? WERR_OK : WERR_GEN_FAILURE;
done:
talloc_free(mem_ctx);
return werr;
struct dcerpc_binding_handle *b = ctx->pipe_hnd->binding_handle;
if (parent == NULL) {
- return WERR_INVALID_PARAM;
+ return WERR_INVALID_PARAMETER;
}
ZERO_STRUCT(valuename);
struct dcerpc_binding_handle *b = ctx->pipe_hnd->binding_handle;
if (parent == NULL) {
- return WERR_INVALID_PARAM;
+ return WERR_INVALID_PARAMETER;
}
ZERO_STRUCT(valuename);
NET_TRANSPORT_RPC,
N_("Get security descriptor"),
N_("net rpc registry getsd\n"
- " Get security descriptior")
+ " Get security descriptor")
},
{
"import",