if (!StrCaseCmp(value, "W3SvcInstalled")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC_ZERO(ctx, 4*sizeof(uint8) )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
*needed = 0x4;
return WERR_OK;
if (!StrCaseCmp(value, "BeepEnabled")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC(ctx, 4*sizeof(uint8) )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
SIVAL(*data, 0, 0x00);
*needed = 0x4;
if (!StrCaseCmp(value, "EventLog")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC(ctx, 4 )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
/* formally was 0x1b */
SIVAL(*data, 0, 0x0);
if (!StrCaseCmp(value, "NetPopup")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC(ctx, 4 )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
SIVAL(*data, 0, 0x00);
*needed = 0x4;
if (!StrCaseCmp(value, "MajorVersion")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC(ctx, 4 )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
/* Windows NT 4.0 seems to not allow uploading of drivers
if (!StrCaseCmp(value, "MinorVersion")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC(ctx, 4 )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
SIVAL(*data, 0, 0);
*needed = 0x4;
*type = REG_BINARY;
*needed = 0x114;
- if ( !(*data = TALLOC_ZERO_ARRAY(ctx, uint8, *needed)) )
+ if ( !(*data = TALLOC_ZERO_ARRAY(ctx, uint8, (*needed > in_size) ? *needed:in_size )) )
return WERR_NOMEM;
SIVAL(*data, 0, *needed); /* size */
if (!StrCaseCmp(value, "DsPresent")) {
*type = REG_DWORD;
- if((*data = (uint8 *)TALLOC(ctx, 4 )) == NULL)
+ if ( !(*data = TALLOC_ARRAY(ctx, uint8, sizeof(uint32) )) )
return WERR_NOMEM;
/* only show the publish check box if we are a