struct in_addr dest_ip;
fstring remote_machine;
NTSTATUS result;
- uint32 neg_flags = 0x000001ff;
+ uint32_t neg_flags = 0x000001ff;
*retry = False;
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(wchar_t, unsigned short)
AC_CHECK_TYPE(uint_t, unsigned int)
+AC_CHECK_TYPE(int32_t, long)
+AC_CHECK_TYPE(uint32_t, unsigned long)
AC_CHECK_TYPE(int64_t, long long)
AC_CHECK_TYPE(uint64_t, unsigned long long)
/*
return a string representing a share type
*/
-static const char *share_type_str(uint32 type)
+static const char *share_type_str(uint32_t type)
{
switch (type & 0xF) {
case STYPE_DISKTREE:
char *binding;
NTSTATUS status;
struct srvsvc_NetShareEnumAll r;
- uint32 resume_handle = 0;
+ uint32_t resume_handle = 0;
TALLOC_CTX *mem_ctx = talloc_init("browse_host");
struct srvsvc_NetShareCtr1 ctr1;
*/
typedef struct _AfpInfo
{
- uint32 afpi_Signature; /* Must be *(PDWORD)"AFP" */
- uint32 afpi_Version; /* Must be 0x00010000 */
- uint32 afpi_Reserved1;
- uint32 afpi_BackupTime; /* Backup time for the file/dir */
+ uint32_t afpi_Signature; /* Must be *(PDWORD)"AFP" */
+ uint32_t afpi_Version; /* Must be 0x00010000 */
+ uint32_t afpi_Reserved1;
+ uint32_t afpi_BackupTime; /* Backup time for the file/dir */
unsigned char afpi_FinderInfo[AFP_FinderSize]; /* Finder Info (32 bytes) */
unsigned char afpi_ProDosInfo[6]; /* ProDos Info (6 bytes) # */
unsigned char afpi_Reserved2[6];
#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos+1)=(unsigned char)((val)>>8))
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
-#define IVALS(buf,pos) ((int32)IVAL(buf,pos))
+#define IVALS(buf,pos) ((int32_t)IVAL(buf,pos))
#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
+#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32_t)(val)))
#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
-#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val)))
+#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val)))
#else /* CAREFUL_ALIGNMENT */
/* this handles things for architectures like the 386 that can handle
alignment errors */
/*
- WARNING: This section is dependent on the length of int16 and int32
+ WARNING: This section is dependent on the length of int16 and int32_t
being correct
*/
/* get single value from an SMB buffer */
#define SVAL(buf,pos) (*(const uint16 *)((const char *)(buf) + (pos)))
#define SVAL_NC(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) /* Non const version of above. */
-#define IVAL(buf,pos) (*(const uint32 *)((const char *)(buf) + (pos)))
-#define IVAL_NC(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) /* Non const version of above. */
+#define IVAL(buf,pos) (*(const uint32_t *)((const char *)(buf) + (pos)))
+#define IVAL_NC(buf,pos) (*(uint32_t *)((char *)(buf) + (pos))) /* Non const version of above. */
#define SVALS(buf,pos) (*(const int16 *)((const char *)(buf) + (pos)))
#define SVALS_NC(buf,pos) (*(int16 *)((char *)(buf) + (pos))) /* Non const version of above. */
-#define IVALS(buf,pos) (*(const int32 *)((const char *)(buf) + (pos)))
-#define IVALS_NC(buf,pos) (*(int32 *)((char *)(buf) + (pos))) /* Non const version of above. */
+#define IVALS(buf,pos) (*(const int32_t *)((const char *)(buf) + (pos)))
+#define IVALS_NC(buf,pos) (*(int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */
/* store single value in an SMB buffer */
#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16)(val))
-#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32)(val))
+#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32_t)(val))
#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val))
-#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32)(val))
+#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32_t)(val))
#endif /* CAREFUL_ALIGNMENT */
int sec_mode; /* security mode returned by negprot */
DATA_BLOB secblob; /* cryptkey or negTokenInit blob */
- uint32 sesskey;
+ uint32_t sesskey;
smb_sign_info sign_info;
/* capabilities that the server reported */
- uint32 capabilities;
+ uint32_t capabilities;
int server_zone;
time_t server_time;
uint16 vuid;
/* default pid for this session */
- uint32 pid;
+ uint32_t pid;
DATA_BLOB user_session_key;
};
BOOL spnego_negotiated;
/* client capabilities */
- uint32 client_caps;
+ uint32_t client_caps;
/* the timezone we sent to the client */
int zone_offset;
void (*print_suspicious_usage)(const char* from, const char* info);
/* function to return process/thread id */
- uint32 (*get_task_id)(void);
+ uint32_t (*get_task_id)(void);
/* function to log process/thread id */
void (*log_task_id)(int fd);
#endif
/*
- Samba needs type definitions for int16, int32, uint16 and uint32.
+ Samba needs type definitions for int16, int32_t, uint16 and uint32_t.
Normally these are signed and unsigned 16 and 32 bit integers, but
they actually only need to be at least 16 and 32 bits
#endif
#if !defined(int32)
-#if (SIZEOF_INT == 4)
-#define int32 int
-#elif (SIZEOF_LONG == 4)
-#define int32 long
-#elif (SIZEOF_SHORT == 4)
-#define int32 short
-#else
-/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define int32 int
-#endif
+#define int32 int32_t
#endif
-
#if !defined(uint32)
-#if (SIZEOF_INT == 4)
-#define uint32 unsigned int
-#elif (SIZEOF_LONG == 4)
-#define uint32 unsigned long
-#elif (SIZEOF_SHORT == 4)
-#define uint32 unsigned short
-#else
-/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define uint32 unsigned
+#define uint32 uint32_t
#endif
+
+#if !defined(int64)
+#define int64 int64_t
#endif
#if !defined(uint64)
#define uint64 uint64_t
#endif
-#if !defined(int64)
-#define int64 int64_t
-#endif
-
/*
* Types for devices, inodes and offsets.
*/
#endif
struct MD5Context {
- uint32 buf[4];
- uint32 bits[2];
+ uint32_t buf[4];
+ uint32_t bits[2];
unsigned char in[64];
};
BOOL RunningElection;
BOOL needelection;
int ElectionCount;
- uint32 ElectionCriterion;
+ uint32_t ElectionCriterion;
/* Domain master browser info. Used for efficient syncs. */
struct nmb_name dmb_name;
*/
#if defined(HAVE_IMMEDIATE_STRUCTURES)
-typedef struct {uint32 v;} NTSTATUS;
+typedef struct {uint32_t v;} NTSTATUS;
#define NT_STATUS(x) ((NTSTATUS) { x })
#define NT_STATUS_V(x) ((x).v)
#else
-typedef uint32 NTSTATUS;
+typedef uint32_t NTSTATUS;
#define NT_STATUS(x) (x)
#define NT_STATUS_V(x) (x)
#endif
#if defined(HAVE_IMMEDIATE_STRUCTURES)
-typedef struct {uint32 v;} WERROR;
+typedef struct {uint32_t v;} WERROR;
#define W_ERROR(x) ((WERROR) { x })
#define W_ERROR_V(x) ((x).v)
#else
-typedef uint32 WERROR;
+typedef uint32_t WERROR;
#define W_ERROR(x) (x)
#define W_ERROR_V(x) (x)
#endif
/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */
typedef struct time_info
{
- uint32 time;
+ uint32_t time;
} UTIME;
/* used to hold an arbitrary blob of data */
struct server_info_struct
{
fstring name;
- uint32 type;
+ uint32_t type;
fstring comment;
fstring domain; /* used ONLY in ipc.c NOT namework.c */
BOOL server_added; /* used ONLY in ipc.c NOT namework.c */
char addr[24];
char machine[FSTRING_LEN];
time_t start;
- uint32 bcast_msg_flags;
+ uint32_t bcast_msg_flags;
};
/* the following are used by loadparm for option lists */
};
struct bitmap {
- uint32 *b;
+ uint32_t *b;
unsigned int n;
};
is used in the structure definition.
*/
typedef struct {
- uint32 private_length;
+ uint32_t private_length;
const char *s;
} WIRE_STRING;
struct {
uint16 fnum;
uint16 mode;
- int32 offset; /* signed */
+ int32_t offset; /* signed */
} in;
struct {
- int32 offset;
+ int32_t offset;
} out;
};
struct {
uint16 attrib;
uint16 flags; /* see RENAME_FLAG_* */
- uint32 cluster_size;
+ uint32_t cluster_size;
const char *old_name;
const char *new_name;
} in;
enum sesssetup_level level;
struct {
- uint32 sesskey;
- uint32 capabilities;
+ uint32_t sesskey;
+ uint32_t capabilities;
const char *password;
const char *user;
const char *domain;
uint16 bufsize;
uint16 mpx_max;
uint16 vc_num;
- uint32 sesskey;
+ uint32_t sesskey;
DATA_BLOB password;
const char *user;
const char *domain;
uint16 bufsize;
uint16 mpx_max;
uint16 vc_num;
- uint32 sesskey;
- uint32 capabilities;
+ uint32_t sesskey;
+ uint32_t capabilities;
DATA_BLOB password1;
DATA_BLOB password2;
const char *user;
uint16 bufsize;
uint16 mpx_max;
uint16 vc_num;
- uint32 sesskey;
- uint32 capabilities;
+ uint32_t sesskey;
+ uint32_t capabilities;
DATA_BLOB secblob;
const char *os;
const char *lanman;
struct {
uint16 attrib;
- uint32 ea_size;
+ uint32_t ea_size;
uint_t num_eas;
struct ea_struct {
uint8 flags;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
- uint32 ex_attrib;
+ uint32_t ex_attrib;
uint64_t alloc_size;
uint64_t size;
- uint32 nlink;
+ uint32_t nlink;
WIRE_STRING fname;
WIRE_STRING alt_fname;
uint8 delete_pending;
uint8 chunk_shift;
uint8 cluster_shift;
uint64_t file_id;
- uint32 access_flags; /* seen 0x001f01ff from w2k3 */
+ uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
uint64_t position;
- uint32 mode;
- uint32 alignment_requirement;
- uint32 reparse_tag;
+ uint32_t mode;
+ uint32_t alignment_requirement;
+ uint32_t reparse_tag;
uint_t num_streams;
struct stream_struct {
uint64_t size;
struct {
uint16 attrib;
- uint32 size;
+ uint32_t size;
time_t write_time;
} out;
} getattr;
time_t create_time;
time_t access_time;
time_t write_time;
- uint32 size;
- uint32 alloc_size;
+ uint32_t size;
+ uint32_t alloc_size;
uint16 attrib;
} out;
} getattre;
time_t create_time;
time_t access_time;
time_t write_time;
- uint32 size;
- uint32 alloc_size;
+ uint32_t size;
+ uint32_t alloc_size;
uint16 attrib;
} out;
} standard;
time_t create_time;
time_t access_time;
time_t write_time;
- uint32 size;
- uint32 alloc_size;
+ uint32_t size;
+ uint32_t alloc_size;
uint16 attrib;
- uint32 ea_size;
+ uint32_t ea_size;
} out;
} ea_size;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
- uint32 attrib;
+ uint32_t attrib;
} out;
} basic_info;
struct {
uint64_t alloc_size;
uint64_t size;
- uint32 nlink;
+ uint32_t nlink;
BOOL delete_pending;
BOOL directory;
} out;
union smb_fileinfo_in in;
struct {
- uint32 ea_size;
+ uint32_t ea_size;
} out;
} ea_info;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
- uint32 attrib;
+ uint32_t attrib;
uint64_t alloc_size;
uint64_t size;
- uint32 nlink;
+ uint32_t nlink;
uint8 delete_pending;
uint8 directory;
- uint32 ea_size;
+ uint32_t ea_size;
WIRE_STRING fname;
} out;
} all_info;
NTTIME change_time;
uint64_t uid;
uint64_t gid;
- uint32 file_type;
+ uint32_t file_type;
uint64_t dev_major;
uint64_t dev_minor;
uint64_t unique_id;
union smb_fileinfo_in in;
struct {
- uint32 access_flags; /* seen 0x001f01ff from w2k3 */
+ uint32_t access_flags; /* seen 0x001f01ff from w2k3 */
} out;
} access_information;
union smb_fileinfo_in in;
struct {
- uint32 mode;
+ uint32_t mode;
} out;
} mode_information;
union smb_fileinfo_in in;
struct {
- uint32 alignment_requirement;
+ uint32_t alignment_requirement;
} out;
} alignment_information;
NTTIME change_time;
uint64_t alloc_size;
uint64_t size;
- uint32 attrib;
+ uint32_t attrib;
} out;
} network_open_information;
union smb_fileinfo_in in;
struct {
- uint32 attrib;
- uint32 reparse_tag;
+ uint32_t attrib;
+ uint32_t reparse_tag;
} out;
} attribute_tag_information;
};
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
- uint32 attrib;
+ uint32_t attrib;
} in;
} basic_info;
struct {
uint8 overwrite;
- uint32 root_fid;
+ uint32_t root_fid;
const char *new_name;
} in;
} rename_information;
struct {
/* valid values seem to be 0, 2, 4 and 6 */
- uint32 mode;
+ uint32_t mode;
} in;
} mode_information;
enum setfileinfo_level level;
union setfileinfo_file file;
struct {
- uint32 mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
+ uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
uint64_t end_of_file;
uint64_t num_bytes;
NTTIME status_change_time;
NTTIME change_time;
uint64_t uid;
uint64_t gid;
- uint32 file_type;
+ uint32_t file_type;
uint64_t dev_major;
uint64_t dev_minor;
uint64_t unique_id;
enum fsinfo_level level;
struct {
- uint32 block_size;
+ uint32_t block_size;
uint64_t blocks_total;
uint64_t blocks_free;
- uint32 fs_id;
+ uint32_t fs_id;
NTTIME create_time;
- uint32 serial_number;
- uint32 fs_attr;
- uint32 max_file_component_length;
- uint32 device_type;
- uint32 device_characteristics;
+ uint32_t serial_number;
+ uint32_t fs_attr;
+ uint32_t max_file_component_length;
+ uint32_t device_type;
+ uint32_t device_characteristics;
uint64_t quota_soft;
uint64_t quota_hard;
uint64_t quota_flags;
enum fsinfo_level level;
struct {
- uint32 fs_id;
- uint32 sectors_per_unit;
- uint32 total_alloc_units;
- uint32 avail_alloc_units;
+ uint32_t fs_id;
+ uint32_t sectors_per_unit;
+ uint32_t total_alloc_units;
+ uint32_t avail_alloc_units;
uint16 bytes_per_sector;
} out;
} allocation;
enum fsinfo_level level;
struct {
- uint32 serial_number;
+ uint32_t serial_number;
WIRE_STRING volume_name;
} out;
} volume;
struct {
NTTIME create_time;
- uint32 serial_number;
+ uint32_t serial_number;
WIRE_STRING volume_name;
} out;
} volume_info;
struct {
uint64_t total_alloc_units;
uint64_t avail_alloc_units; /* maps to call_avail_alloc_units */
- uint32 sectors_per_unit;
- uint32 bytes_per_sector;
+ uint32_t sectors_per_unit;
+ uint32_t bytes_per_sector;
} out;
} size_info;
enum fsinfo_level level;
struct {
- uint32 device_type;
- uint32 characteristics;
+ uint32_t device_type;
+ uint32_t characteristics;
} out;
} device_info;
enum fsinfo_level level;
struct {
- uint32 fs_attr;
- uint32 max_file_component_length;
+ uint32_t fs_attr;
+ uint32_t max_file_component_length;
WIRE_STRING fs_type;
} out;
} attribute_info;
uint64_t total_alloc_units;
uint64_t call_avail_alloc_units;
uint64_t actual_avail_alloc_units;
- uint32 sectors_per_unit;
- uint32 bytes_per_sector;
+ uint32_t sectors_per_unit;
+ uint32_t bytes_per_sector;
} out;
} full_size_information;
enum open_level level;
struct {
- uint32 flags;
- uint32 root_fid;
- uint32 access_mask;
+ uint32_t flags;
+ uint32_t root_fid;
+ uint32_t access_mask;
uint64_t alloc_size;
- uint32 file_attr;
- uint32 share_access;
- uint32 open_disposition;
- uint32 create_options;
- uint32 impersonation;
+ uint32_t file_attr;
+ uint32_t share_access;
+ uint32_t open_disposition;
+ uint32_t create_options;
+ uint32_t impersonation;
uint8 security_flags;
const char *fname;
} in;
struct {
uint8 oplock_level;
uint16 fnum;
- uint32 create_action;
+ uint32_t create_action;
NTTIME create_time;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
- uint32 attrib;
+ uint32_t attrib;
uint64_t alloc_size;
uint64_t size;
uint16 file_type;
uint16 file_attrs;
time_t write_time;
uint16 open_func;
- uint32 size;
- uint32 timeout;
+ uint32_t size;
+ uint32_t timeout;
const char *fname;
uint_t num_eas;
struct ea_struct *eas;
uint16 fnum;
uint16 attrib;
time_t write_time;
- uint32 size;
+ uint32_t size;
uint16 access;
uint16 ftype;
uint16 devstate;
uint16 action;
- uint32 unknown;
+ uint32_t unknown;
} out;
} t2open;
uint16 fnum;
uint16 attrib;
time_t write_time;
- uint32 size;
+ uint32_t size;
uint16 rmode;
} out;
} open;
uint16 file_attrs;
time_t write_time; /* not honoured by win2003 */
uint16 open_func;
- uint32 size; /* note that this sets the
+ uint32_t size; /* note that this sets the
initial file size, not
just allocation size */
- uint32 timeout; /* not honoured by win2003 */
+ uint32_t timeout; /* not honoured by win2003 */
const char *fname;
} in;
struct {
uint16 fnum;
uint16 attrib;
time_t write_time;
- uint32 size;
+ uint32_t size;
uint16 access;
uint16 ftype;
uint16 devstate;
uint16 action;
- uint32 unique_fid;
- uint32 access_mask;
- uint32 unknown;
+ uint32_t unique_fid;
+ uint32_t access_mask;
+ uint32_t unknown;
} out;
} openx;
struct {
uint16 fnum;
uint64_t offset;
- uint32 size;
+ uint32_t size;
} in;
struct {
char *data;
- uint32 nread;
+ uint32_t nread;
} out;
} generic;
uint64_t offset;
uint16 maxcnt;
uint16 mincnt;
- uint32 timeout;
+ uint32_t timeout;
} in;
struct {
char *data;
- uint32 nread;
+ uint32_t nread;
} out;
} readbraw;
struct {
uint16 fnum;
uint16 count;
- uint32 offset;
+ uint32_t offset;
uint16 remaining;
} in;
struct {
struct {
uint16 fnum;
uint16 count;
- uint32 offset;
+ uint32_t offset;
uint16 remaining;
} in;
struct {
struct {
uint16 fnum;
uint64_t offset;
- uint32 count;
+ uint32_t count;
const char *data;
} in;
struct {
- uint32 nwritten;
+ uint32_t nwritten;
} out;
} generic;
struct {
uint16 fnum;
uint16 count;
- uint32 offset;
+ uint32_t offset;
uint16 remaining;
const char *data;
} in;
struct {
- uint32 nwritten;
+ uint32_t nwritten;
} out;
} writeunlock;
struct {
uint16 fnum;
uint16 count;
- uint32 offset;
+ uint32_t offset;
uint16 remaining;
const char *data;
} in;
uint64_t offset;
uint16 wmode;
uint16 remaining;
- uint32 count;
+ uint32_t count;
const char *data;
} in;
struct {
- uint32 nwritten;
+ uint32_t nwritten;
uint16 remaining;
} out;
} writex;
struct {
uint16 fnum;
uint16 count;
- uint32 offset;
+ uint32_t offset;
time_t mtime;
const char *data;
} in;
struct {
uint16 fnum;
- uint32 count;
- uint32 offset;
+ uint32_t count;
+ uint32_t offset;
} in;
} lock;
struct {
uint16 fnum;
- uint32 count;
- uint32 offset;
+ uint32_t count;
+ uint32_t offset;
} in;
} unlock;
struct {
uint16 fnum;
uint16 mode;
- uint32 timeout;
+ uint32_t timeout;
uint16 ulock_cnt;
uint16 lock_cnt;
struct smb_lock_entry {
time_t time;
uint8 status;
uint16 job;
- uint32 size;
+ uint32_t size;
char *user;
} *queue;
} out;
enum ioctl_level level;
struct {
uint16 fnum;
- uint32 request;
+ uint32_t request;
} in;
struct {
DATA_BLOB blob;
struct {
enum ioctl_level level;
struct {
- uint32 function;
+ uint32_t function;
uint16 fnum;
BOOL fsctl;
uint8 filter;
uint16 max_data;
uint8 max_setup;
uint16 flags;
- uint32 timeout;
+ uint32_t timeout;
uint8 setup_count;
uint16 *setup;
const char *trans_name; /* SMBtrans only */
struct smb_nttrans {
struct {
uint8 max_setup;
- uint32 max_param;
- uint32 max_data;
- uint32 setup_count;
+ uint32_t max_param;
+ uint32_t max_data;
+ uint32_t setup_count;
uint16 function;
uint16 *setup;
DATA_BLOB params;
/* struct for nttrans change notify call */
struct smb_notify {
struct {
- uint32 buffer_size;
- uint32 completion_filter;
+ uint32_t buffer_size;
+ uint32_t completion_filter;
uint16 fnum;
BOOL recursive;
} in;
struct {
- uint32 num_changes;
+ uint32_t num_changes;
struct {
- uint32 action;
+ uint32_t action;
WIRE_STRING name;
} *changes;
} out;
uint16 search_attrib;
uint16 max_count;
uint16 flags;
- uint32 storage_type;
+ uint32_t storage_type;
const char *pattern;
} in;
struct {
struct {
uint16 handle;
uint16 max_count;
- uint32 resume_key;
+ uint32_t resume_key;
uint16 flags;
const char *last_name;
} in;
struct {
uint16 attrib;
time_t write_time;
- uint32 size;
+ uint32_t size;
DATA_BLOB search_id; /* used to resume search from this point */
char *name;
} search;
/* trans2 findfirst RAW_SEARCH_STANDARD level */
struct {
- uint32 resume_key;
+ uint32_t resume_key;
time_t create_time;
time_t access_time;
time_t write_time;
- uint32 size;
- uint32 alloc_size;
+ uint32_t size;
+ uint32_t alloc_size;
uint16 attrib;
WIRE_STRING name;
} standard;
/* trans2 findfirst RAW_SEARCH_EA_SIZE level */
struct {
- uint32 resume_key;
+ uint32_t resume_key;
time_t create_time;
time_t access_time;
time_t write_time;
- uint32 size;
- uint32 alloc_size;
+ uint32_t size;
+ uint32_t alloc_size;
uint16 attrib;
- uint32 ea_size;
+ uint32_t ea_size;
WIRE_STRING name;
} ea_size;
/* RAW_SEARCH_DIRECTORY_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
NTTIME create_time;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
uint64_t size;
uint64_t alloc_size;
- uint32 attrib;
+ uint32_t attrib;
WIRE_STRING name;
} directory_info;
/* RAW_SEARCH_FULL_DIRECTORY_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
NTTIME create_time;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
uint64_t size;
uint64_t alloc_size;
- uint32 attrib;
- uint32 ea_size;
+ uint32_t attrib;
+ uint32_t ea_size;
WIRE_STRING name;
} full_directory_info;
/* RAW_SEARCH_NAME_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
WIRE_STRING name;
} name_info;
/* RAW_SEARCH_BOTH_DIRECTORY_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
NTTIME create_time;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
uint64_t size;
uint64_t alloc_size;
- uint32 attrib;
- uint32 ea_size;
+ uint32_t attrib;
+ uint32_t ea_size;
WIRE_STRING short_name;
WIRE_STRING name;
} both_directory_info;
/* RAW_SEARCH_ID_FULL_DIRECTORY_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
NTTIME create_time;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
uint64_t size;
uint64_t alloc_size;
- uint32 attrib;
- uint32 ea_size;
+ uint32_t attrib;
+ uint32_t ea_size;
uint64_t file_id;
WIRE_STRING name;
} id_full_directory_info;
/* RAW_SEARCH_ID_BOTH_DIRECTORY_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
NTTIME create_time;
NTTIME access_time;
NTTIME write_time;
NTTIME change_time;
uint64_t size;
uint64_t alloc_size;
- uint32 attrib;
- uint32 ea_size;
+ uint32_t attrib;
+ uint32_t ea_size;
uint64_t file_id;
WIRE_STRING short_name;
WIRE_STRING name;
/* RAW_SEARCH_UNIX_INFO interface */
struct {
- uint32 file_index;
+ uint32_t file_index;
uint64_t size;
uint64_t alloc_size;
NTTIME status_change_time;
NTTIME change_time;
uint64_t uid;
uint64_t gid;
- uint32 file_type;
+ uint32_t file_type;
uint64_t dev_major;
uint64_t dev_minor;
uint64_t unique_id;
Used by dptr_zero.
****************************************************************************/
-#define DPTR_MASK ((uint32)(((uint32)1)<<31))
+#define DPTR_MASK ((uint32_t)(((uint32_t)1)<<31))
/****************************************************************************
Return True if the offset is at zero.
if (!bm) return NULL;
bm->n = n;
- bm->b = (uint32 *)malloc(sizeof(bm->b[0])*(n+31)/32);
+ bm->b = (uint32_t *)malloc(sizeof(bm->b[0])*(n+31)/32);
if (!bm->b) {
SAFE_FREE(bm);
return NULL;
if (!bm) return NULL;
bm->n = n;
- bm->b = (uint32 *)talloc(mem_ctx, sizeof(bm->b[0])*(n+31)/32);
+ bm->b = (uint32_t *)talloc(mem_ctx, sizeof(bm->b[0])*(n+31)/32);
if (!bm->b) {
return NULL;
}
0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D
};
-uint32 crc32_calc_buffer( const char *buffer, uint32 count)
+uint32_t crc32_calc_buffer( const char *buffer, uint32_t count)
{
- uint32 crc=0xffffffff, i;
+ uint32_t crc=0xffffffff, i;
for(i=0;i<count;i++)
crc = (crc>>8) ^ CRCTable[(buffer[i] ^ crc) & 0xff];
crc^=0xffffffff;
*/
struct mdfour_state {
- uint32 A, B, C, D;
+ uint32_t A, B, C, D;
};
-static uint32 F(uint32 X, uint32 Y, uint32 Z)
+static uint32_t F(uint32_t X, uint32_t Y, uint32_t Z)
{
return (X&Y) | ((~X)&Z);
}
-static uint32 G(uint32 X, uint32 Y, uint32 Z)
+static uint32_t G(uint32_t X, uint32_t Y, uint32_t Z)
{
return (X&Y) | (X&Z) | (Y&Z);
}
-static uint32 H(uint32 X, uint32 Y, uint32 Z)
+static uint32_t H(uint32_t X, uint32_t Y, uint32_t Z)
{
return X^Y^Z;
}
-static uint32 lshift(uint32 x, int s)
+static uint32_t lshift(uint32_t x, int s)
{
x &= 0xFFFFFFFF;
return ((x<<s)&0xFFFFFFFF) | (x>>(32-s));
}
#define ROUND1(a,b,c,d,k,s) a = lshift(a + F(b,c,d) + X[k], s)
-#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + (uint32)0x5A827999,s)
-#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + (uint32)0x6ED9EBA1,s)
+#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + (uint32_t)0x5A827999,s)
+#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + (uint32_t)0x6ED9EBA1,s)
/* this applies md4 to 64 byte chunks */
-static void mdfour64(struct mdfour_state *s, uint32 *M)
+static void mdfour64(struct mdfour_state *s, uint32_t *M)
{
int j;
- uint32 AA, BB, CC, DD;
- uint32 X[16];
+ uint32_t AA, BB, CC, DD;
+ uint32_t X[16];
for (j=0;j<16;j++)
X[j] = M[j];
X[j] = 0;
}
-static void copy64(uint32 *M, const unsigned char *in)
+static void copy64(uint32_t *M, const unsigned char *in)
{
int i;
(in[i*4+1]<<8) | (in[i*4+0]<<0);
}
-static void copy4(unsigned char *out, uint32 x)
+static void copy4(unsigned char *out, uint32_t x)
{
out[0] = x&0xFF;
out[1] = (x>>8)&0xFF;
void mdfour(unsigned char *out, const unsigned char *in, int n)
{
unsigned char buf[128];
- uint32 M[16];
- uint32 b = n * 8;
+ uint32_t M[16];
+ uint32_t b = n * 8;
int i;
struct mdfour_state state;
#include "md5.h"
-static void MD5Transform(uint32 buf[4], uint32 const in[16]);
+static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
/*
* Note: this code is harmless on little-endian machines.
*/
static void byteReverse(unsigned char *buf, unsigned longs)
{
- uint32 t;
+ uint32_t t;
do {
- t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+ t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
- *(uint32 *) buf = t;
+ *(uint32_t *) buf = t;
buf += 4;
} while (--longs);
}
*/
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
{
- register uint32 t;
+ register uint32_t t;
/* Update bitcount */
t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
+ if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
}
memmove(p, buf, t);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += t;
len -= t;
}
while (len >= 64) {
memmove(ctx->in, buf, 64);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += 64;
len -= 64;
}
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
+ ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+ ((uint32_t *) ctx->in)[15] = ctx->bits[1];
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
memmove(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
-static void MD5Transform(uint32 buf[4], uint32 const in[16])
+static void MD5Transform(uint32_t buf[4], uint32_t const in[16])
{
- register uint32 a, b, c, d;
+ register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
}
}
-uint32 get_task_id(void)
+uint32_t get_task_id(void)
{
if (debug_handlers.ops.get_task_id) {
return debug_handlers.ops.get_task_id();
#include "includes.h"
static unsigned char hash[258];
-static uint32 counter;
+static uint32_t counter;
static unsigned char *reseed_data;
static size_t reseed_data_size;
static int do_reseed(BOOL use_fd, int fd)
{
unsigned char seed_inbuf[40];
- uint32 v1, v2; struct timeval tval; pid_t mypid;
+ uint32_t v1, v2; struct timeval tval; pid_t mypid;
if (use_fd) {
if (fd != -1)
static struct interface *local_interfaces;
-#define ALLONES ((uint32)0xFFFFFFFF)
+#define ALLONES ((uint32_t)0xFFFFFFFF)
#define MKBCADDR(_IP, _NM) ((_IP & _NM) | (_NM ^ ALLONES))
#define MKNETADDR(_IP, _NM) (_IP & _NM)
struct msg_all {
int msg_type;
- uint32 msg_flag;
+ uint32_t msg_flag;
const void *buf;
size_t len;
BOOL duplicates;
return WERR_OK;
}
-WERROR reg_key_add_name(REG_KEY *parent, const char *name, uint32 access_mask, SEC_DESC *desc, REG_KEY **newkey)
+WERROR reg_key_add_name(REG_KEY *parent, const char *name, uint32_t access_mask, SEC_DESC *desc, REG_KEY **newkey)
{
WERROR error;
/**********************************************************************
*********************************************************************/
-uint32 reg_val_type( REG_VAL *val )
+uint32_t reg_val_type( REG_VAL *val )
{
return val->data_type;
}
return reg_key_get_value_by_name(k, valname, val);
}
-WERROR reg_key_set_subkey_val(REG_KEY *key, const char *subname, const char *valname, uint32 type, uint8 *data, int real_len)
+WERROR reg_key_set_subkey_val(REG_KEY *key, const char *subname, const char *valname, uint32_t type, uint8 *data, int real_len)
{
REG_KEY *k;
REG_VAL *v;
WERROR (*request_value_change_notify) (REG_VAL *, value_notification_function);
/* Key management */
- WERROR (*add_key)(REG_KEY *, const char *name, uint32 access_mask, SEC_DESC *, REG_KEY **);
+ WERROR (*add_key)(REG_KEY *, const char *name, uint32_t access_mask, SEC_DESC *, REG_KEY **);
WERROR (*del_key)(REG_KEY *);
/* Value management */
#include "includes.h"
#include "lib/registry/common/registry.h"
-static WERROR reg_dir_add_key(REG_KEY *parent, const char *name, uint32 access_mask, SEC_DESC *desc, REG_KEY **result)
+static WERROR reg_dir_add_key(REG_KEY *parent, const char *name, uint32_t access_mask, SEC_DESC *desc, REG_KEY **result)
{
char *path;
int ret;
/*
* Create an ACE
*/
-static BOOL nt_create_ace(SEC_ACE *ace, int type, int flags, uint32 perms, const char *sid)
+static BOOL nt_create_ace(SEC_ACE *ace, int type, int flags, uint32_t perms, const char *sid)
{
DOM_SID s;
SEC_ACCESS access;
struct winreg_EnumValueName vn;
NTSTATUS status;
struct rpc_key_data *mykeydata;
- uint32 type = 0x0, requested_len = 0, returned_len = 0;
+ uint32_t type = 0x0, requested_len = 0, returned_len = 0;
WERROR error;
error = rpc_key_put_rpc_data(parent, &mykeydata);
return r.out.result;
}
-static WERROR rpc_add_key(REG_KEY *parent, const char *name, uint32 access_mask, SEC_DESC *sec, REG_KEY **key)
+static WERROR rpc_add_key(REG_KEY *parent, const char *name, uint32_t access_mask, SEC_DESC *sec, REG_KEY **key)
{
struct rpc_key_data *mykeydata;
WERROR error;
/**************************************************************************
Try and abstract process capabilities (for systems that have them).
****************************************************************************/
-static BOOL set_process_capability( uint32 cap_flag, BOOL enable )
+static BOOL set_process_capability( uint32_t cap_flag, BOOL enable )
{
if(cap_flag == KERNEL_OPLOCK_CAPABILITY) {
cap_t cap = cap_get_proc();
Try and abstract inherited process capabilities (for systems that have them).
****************************************************************************/
-static BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable )
+static BOOL set_inherited_process_capability( uint32_t cap_flag, BOOL enable )
{
if(cap_flag == KERNEL_OPLOCK_CAPABILITY) {
cap_t cap = cap_get_proc();
/****************************************************************************
- Fetch a int32 value by a arbitrary blob key, return -1 if not found.
- Output is int32 in native byte order.
+ Fetch a int32_t value by a arbitrary blob key, return -1 if not found.
+ Output is int32_t in native byte order.
****************************************************************************/
-int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len)
+int32_t tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len)
{
TDB_DATA key = make_tdb_data(keyval, len);
TDB_DATA data;
- int32 ret;
+ int32_t ret;
data = tdb_fetch(tdb, key);
if (!data.dptr || data.dsize != sizeof(int32)) {
}
/****************************************************************************
- Fetch a int32 value by string key, return -1 if not found.
- Output is int32 in native byte order.
+ Fetch a int32_t value by string key, return -1 if not found.
+ Output is int32_t in native byte order.
****************************************************************************/
-int32 tdb_fetch_int32(TDB_CONTEXT *tdb, const char *keystr)
+int32_t tdb_fetch_int32(TDB_CONTEXT *tdb, const char *keystr)
{
return tdb_fetch_int32_byblob(tdb, keystr, strlen(keystr) + 1);
}
/****************************************************************************
- Store a int32 value by an arbitary blob key, return 0 on success, -1 on failure.
- Input is int32 in native byte order. Output in tdb is in little-endian.
+ Store a int32_t value by an arbitary blob key, return 0 on success, -1 on failure.
+ Input is int32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-int tdb_store_int32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, int32 v)
+int tdb_store_int32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, int32_t v)
{
TDB_DATA key = make_tdb_data(keystr, len);
TDB_DATA data;
- int32 v_store;
+ int32_t v_store;
SIVAL(&v_store,0,v);
data.dptr = (void *)&v_store;
}
/****************************************************************************
- Store a int32 value by string key, return 0 on success, -1 on failure.
- Input is int32 in native byte order. Output in tdb is in little-endian.
+ Store a int32_t value by string key, return 0 on success, -1 on failure.
+ Input is int32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-int tdb_store_int32(TDB_CONTEXT *tdb, const char *keystr, int32 v)
+int tdb_store_int32(TDB_CONTEXT *tdb, const char *keystr, int32_t v)
{
return tdb_store_int32_byblob(tdb, keystr, strlen(keystr) + 1, v);
}
/****************************************************************************
- Fetch a uint32 value by a arbitrary blob key, return -1 if not found.
- Output is uint32 in native byte order.
+ Fetch a uint32_t value by a arbitrary blob key, return -1 if not found.
+ Output is uint32_t in native byte order.
****************************************************************************/
-BOOL tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len, uint32 *value)
+BOOL tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len, uint32_t *value)
{
TDB_DATA key = make_tdb_data(keyval, len);
TDB_DATA data;
}
/****************************************************************************
- Fetch a uint32 value by string key, return -1 if not found.
- Output is uint32 in native byte order.
+ Fetch a uint32_t value by string key, return -1 if not found.
+ Output is uint32_t in native byte order.
****************************************************************************/
-BOOL tdb_fetch_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32 *value)
+BOOL tdb_fetch_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32_t *value)
{
return tdb_fetch_uint32_byblob(tdb, keystr, strlen(keystr) + 1, value);
}
/****************************************************************************
- Store a uint32 value by an arbitary blob key, return 0 on success, -1 on failure.
- Input is uint32 in native byte order. Output in tdb is in little-endian.
+ Store a uint32_t value by an arbitary blob key, return 0 on success, -1 on failure.
+ Input is uint32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-BOOL tdb_store_uint32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, uint32 value)
+BOOL tdb_store_uint32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, uint32_t value)
{
TDB_DATA key = make_tdb_data(keystr, len);
TDB_DATA data;
- uint32 v_store;
+ uint32_t v_store;
BOOL ret = True;
SIVAL(&v_store, 0, value);
}
/****************************************************************************
- Store a uint32 value by string key, return 0 on success, -1 on failure.
- Input is uint32 in native byte order. Output in tdb is in little-endian.
+ Store a uint32_t value by string key, return 0 on success, -1 on failure.
+ Input is uint32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-BOOL tdb_store_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32 value)
+BOOL tdb_store_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32_t value)
{
return tdb_store_uint32_byblob(tdb, keystr, strlen(keystr) + 1, value);
}
Atomic integer change. Returns old value. To create, set initial value in *oldval.
****************************************************************************/
-int32 tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32 *oldval, int32 change_val)
+int32_t tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32_t *oldval, int32_t change_val)
{
- int32 val;
- int32 ret = -1;
+ int32_t val;
+ int32_t ret = -1;
if (tdb_lock_bystring(tdb, keystr,0) == -1)
return -1;
Atomic unsigned integer change. Returns old value. To create, set initial value in *oldval.
****************************************************************************/
-BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32 *oldval, uint32 change_val)
+BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32_t *oldval, uint32_t change_val)
{
- uint32 val;
+ uint32_t val;
BOOL ret = False;
if (tdb_lock_bystring(tdb, keystr,0) == -1)
va_list ap;
uint8 bt;
uint16 w;
- uint32 d;
+ uint32_t d;
int i;
void *p;
int len;
va_list ap;
uint8 *bt;
uint16 *w;
- uint32 *d;
+ uint32_t *d;
int len;
int *i;
void **p;
break;
case 'd':
len = 4;
- d = va_arg(ap, uint32 *);
+ d = va_arg(ap, uint32_t *);
if (bufsize < len)
goto no_space;
*d = IVAL(buf, 0);
create a 32 bit dos packed date/time from some parameters
This takes a GMT time and returns a packed localtime structure
********************************************************************/
-static uint32 make_dos_date(time_t unixdate, int zone_offset)
+static uint32_t make_dos_date(time_t unixdate, int zone_offset)
{
struct tm *t;
- uint32 ret=0;
+ uint32_t ret=0;
if (unixdate == 0) {
return 0;
********************************************************************/
void push_dos_date(char *buf, int offset, time_t unixdate, int zone_offset)
{
- uint32 x = make_dos_date(unixdate, zone_offset);
+ uint32_t x = make_dos_date(unixdate, zone_offset);
SIVAL(buf,offset,x);
}
********************************************************************/
void push_dos_date2(char *buf,int offset,time_t unixdate, int zone_offset)
{
- uint32 x;
+ uint32_t x;
x = make_dos_date(unixdate, zone_offset);
x = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
SIVAL(buf,offset,x);
/*******************************************************************
interpret a 32 bit dos packed date/time to some parameters
********************************************************************/
-static void interpret_dos_date(uint32 date,int *year,int *month,int *day,int *hour,int *minute,int *second)
+static void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second)
{
- uint32 p0,p1,p2,p3;
+ uint32_t p0,p1,p2,p3;
p0=date&0xFF; p1=((date&0xFF00)>>8)&0xFF;
p2=((date&0xFF0000)>>16)&0xFF; p3=((date&0xFF000000)>>24)&0xFF;
********************************************************************/
time_t pull_dos_date(const uint8 *date_ptr, int zone_offset)
{
- uint32 dos_date=0;
+ uint32_t dos_date=0;
struct tm t;
time_t ret;
********************************************************************/
time_t pull_dos_date2(const uint8 *date_ptr, int zone_offset)
{
- uint32 x,x2;
+ uint32_t x,x2;
x = IVAL(date_ptr,0);
x2 = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
Interpret an internet address or name into an IP address in 4 byte form.
****************************************************************************/
-uint32 interpret_addr(const char *str)
+uint32_t interpret_addr(const char *str)
{
struct hostent *hp;
- uint32 res;
+ uint32_t res;
if (strcmp(str,"0.0.0.0") == 0)
return(0);
putip((char *)&res,(char *)hp->h_addr);
}
- if (res == (uint32)-1)
+ if (res == (uint32_t)-1)
return(0);
return(res);
struct in_addr *interpret_addr2(TALLOC_CTX *mem_ctx, const char *str)
{
struct in_addr *ret;
- uint32 a = interpret_addr(str);
+ uint32_t a = interpret_addr(str);
ret = talloc(mem_ctx, sizeof(struct in_addr));
if (!ret) return NULL;
BOOL is_zero_ip(struct in_addr ip)
{
- uint32 a;
+ uint32_t a;
putip((char *)&a,(char *)&ip);
return(a == 0);
}
BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask)
{
- uint32 net1,net2,nmask;
+ uint32_t net1,net2,nmask;
nmask = ntohl(mask.s_addr);
net1 = ntohl(ip1.s_addr);
{SID_NAME_USE_NONE, NULL}
};
-const char *sid_type_lookup(uint32 sid_type)
+const char *sid_type_lookup(uint32_t sid_type)
{
int i = 0;
Return the last rid from the end of a sid
*****************************************************************/
-BOOL sid_peek_rid(const struct dom_sid *sid, uint32 *rid)
+BOOL sid_peek_rid(const struct dom_sid *sid, uint32_t *rid)
{
if (!sid || !rid)
return False;
and check the sid against the exp_dom_sid
*****************************************************************/
-BOOL sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32 *rid)
+BOOL sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32_t *rid)
{
if (!exp_dom_sid || !sid || !rid)
return False;
if (sid == NULL)
return 0;
- return sid->num_auths * sizeof(uint32) + 8;
+ return sid->num_auths * sizeof(uint32_t) + 8;
}
/*****************************************************************
/****************************************************************************
Open a socket of the specified type, port, and address for incoming data.
****************************************************************************/
-int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL rebind )
+int open_socket_in( int type, int port, int dlevel, uint32_t socket_addr, BOOL rebind )
{
struct sockaddr_in sock;
int res;
ADS_STATUS rc;
void *res = NULL;
char *ldap_exp;
- uint32 t;
+ uint32_t t;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
char *escaped_name = escape_ldap_string_alloc(name);
char *escaped_realm = escape_ldap_string_alloc(ads->config.realm);
goto done;
}
- if (!ads_pull_uint32(ads, res, "sAMAccountType", &t)) {
+ if (!ads_pull_uint32_t(ads, res, "sAMAccountType", &t)) {
DEBUG(1,("No sAMAccountType for %s !?\n", name));
goto done;
}
void *msg = NULL;
char *ldap_exp = NULL;
char *sidstr = NULL;
- uint32 atype;
+ uint32_t atype;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
if (!(sidstr = sid_binstring(sid))) {
goto done;
}
- if (!ads_pull_uint32(ads, msg, "sAMAccountType", &atype)) {
+ if (!ads_pull_uint32_t(ads, msg, "sAMAccountType", &atype)) {
goto done;
}
*/
const char *ads_errstr(ADS_STATUS status)
{
- uint32 msg_ctx;
+ uint32_t msg_ctx;
static char *ret;
SAFE_FREE(ret);
#ifdef HAVE_GSSAPI
case ENUM_ADS_ERROR_GSS:
{
- uint32 minor;
+ uint32_t minor;
gss_buffer_desc msg1, msg2;
msg1.value = NULL;
#include "includes.h"
static struct perm_mask_str {
- uint32 mask;
+ uint32_t mask;
const char *str;
} perms[] = {
{SEC_RIGHTS_FULL_CTRL, "[Full Control]"},
};
/* convert a security permissions into a string */
-static void ads_disp_perms(uint32 type)
+static void ads_disp_perms(uint32_t type)
{
int i = 0;
int j = 0;
add a machine account to the ADS server
*/
static ADS_STATUS ads_add_machine_acct(ADS_STRUCT *ads, const char *hostname,
- uint32 account_type,
+ uint32_t account_type,
const char *org_unit)
{
ADS_STATUS ret, status;
}
struct uuid {
- uint32 i1;
+ uint32_t i1;
uint16 i2;
uint16 i3;
uint8 s[8];
* @return status of join
**/
ADS_STATUS ads_join_realm(ADS_STRUCT *ads, const char *hostname,
- uint32 account_type, const char *org_unit)
+ uint32_t account_type, const char *org_unit)
{
ADS_STATUS status;
LDAPMessage *res;
}
/**
- * pull a single uint32 from a ADS result
+ * pull a single uint32_t from a ADS result
* @param ads connection to ads server
* @param msg Results of search
* @param field Attribute to retrieve
* @param v Pointer to int to store result
* @return boolean inidicating success
*/
-BOOL ads_pull_uint32(ADS_STRUCT *ads,
- void *msg, const char *field, uint32 *v)
+BOOL ads_pull_uint32_t(ADS_STRUCT *ads,
+ void *msg, const char *field, uint32_t *v)
{
char **values;
* @param usn Pointer to retrieved update serial number
* @return status of search
**/
-ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn)
+ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32_t *usn)
{
const char *attrs[] = {"highestCommittedUSN", NULL};
ADS_STATUS status;
return ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
}
- ads_pull_uint32(ads, res, "highestCommittedUSN", usn);
+ ads_pull_uint32_t(ads, res, "highestCommittedUSN", usn);
ads_msgfree(ads, res);
return ADS_SUCCESS;
}
if (value->type != REG_DWORD)
return False;
- str_value = talloc_asprintf(ctx, "%d", *((uint32 *) value->data_p));
+ str_value = talloc_asprintf(ctx, "%d", *((uint32_t *) value->data_p));
status = ads_mod_str(ctx, mods, value->valuename, str_value);
return ADS_ERR_OK(status);
}
{
char **str_values = NULL;
smb_ucs2_t *cur_str = (smb_ucs2_t *) value->data_p;
- uint32 size = 0, num_vals = 0, i=0;
+ uint32_t size = 0, num_vals = 0, i=0;
ADS_STATUS status;
if (value->type != REG_MULTI_SZ)
char *printername, *servername;
REGVAL_CTR dsdriver_ctr, dsspooler_ctr;
BOOL got_dsdriver = False, got_dsspooler = False;
- uint32 needed, i;
+ uint32_t needed, i;
POLICY_HND pol;
asprintf(&servername, "\\\\%s", cli->desthost);
ADS_MODLIST *mods,
NT_PRINTER_DATA *data)
{
- uint32 key,val;
+ uint32_t key,val;
for (key=0; key < data->num_keys; key++) {
REGVAL_CTR ctr = data->keys[key].values;
DATA_BLOB blob, chal1, chal2, auth;
uint8 challenge[8];
uint8 nthash[24], lmhash[24], sess_key[16];
- uint32 neg_flags;
+ uint32_t neg_flags;
struct berval cred, *scred;
ADS_STATUS status;
int rc;
*/
static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
{
- uint32 minor_status;
+ uint32_t minor_status;
gss_name_t serv_name;
gss_buffer_desc input_name;
gss_ctx_id_t context_handle;
gss_OID mech_type = GSS_C_NULL_OID;
gss_buffer_desc output_token, input_token;
- uint32 ret_flags, conf_state;
+ uint32_t ret_flags, conf_state;
struct berval cred;
struct berval *scred;
int i=0;
int gss_rc, rc;
uint8 *p;
- uint32 max_msg_size;
+ uint32_t max_msg_size;
char *sname;
unsigned sec_layer;
ADS_STATUS status;
char *new_password;
char *service_principal = NULL;
ADS_STATUS ret;
- uint32 sec_channel_type;
+ uint32_t sec_channel_type;
if ((password = secrets_fetch_machine_password(lp_workgroup(), NULL, &sec_channel_type)) == NULL) {
DEBUG(1,("Failed to retrieve password for principal %s\n", host_principal));
const uint8 machine_password[16])
{
struct netr_Credential time_cred;
- uint32 sum[2];
+ uint32_t sum[2];
uint8 sum2[8];
dump_data_pw("Client chall", client_challenge->data, sizeof(client_challenge->data));
struct creds_CredentialState {
uint8 session_key[8];
- uint32 sequence;
+ uint32_t sequence;
struct netr_Credential seed;
struct netr_Credential client;
struct netr_Credential server;
* @param neg_flags The flags from the packet
*/
-void debug_ntlmssp_flags(uint32 neg_flags)
+void debug_ntlmssp_flags(uint32_t neg_flags)
{
DEBUG(3,("Got NTLMSSP neg_flags=0x%08x\n", neg_flags));
const DATA_BLOB in, DATA_BLOB *out)
{
DATA_BLOB input;
- uint32 ntlmssp_command;
+ uint32_t ntlmssp_command;
int i;
*out = data_blob(NULL, 0);
*/
static const char *ntlmssp_target_name(struct ntlmssp_state *ntlmssp_state,
- uint32 neg_flags, uint32 *chal_flags)
+ uint32_t neg_flags, uint32_t *chal_flags)
{
if (neg_flags & NTLMSSP_REQUEST_TARGET) {
*chal_flags |= NTLMSSP_CHAL_TARGET_INFO;
}
static void ntlmssp_handle_neg_flags(struct ntlmssp_state *ntlmssp_state,
- uint32 neg_flags, BOOL allow_lm) {
+ uint32_t neg_flags, BOOL allow_lm) {
if (neg_flags & NTLMSSP_NEGOTIATE_UNICODE) {
ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_UNICODE;
ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_OEM;
{
DATA_BLOB struct_blob;
fstring dnsname, dnsdomname;
- uint32 neg_flags = 0;
- uint32 ntlmssp_command, chal_flags;
+ uint32_t neg_flags = 0;
+ uint32_t ntlmssp_command, chal_flags;
char *cliname=NULL, *domname=NULL;
const uint8 *cryptkey;
const char *target_name;
static NTSTATUS ntlmssp_server_preauth(struct ntlmssp_state *ntlmssp_state,
const DATA_BLOB request)
{
- uint32 ntlmssp_command, auth_flags;
+ uint32_t ntlmssp_command, auth_flags;
NTSTATUS nt_status;
uchar session_nonce_hash[16];
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- uint32 chal_flags, ntlmssp_command, unkn1, unkn2;
+ uint32_t chal_flags, ntlmssp_command, unkn1, unkn2;
DATA_BLOB server_domain_blob;
DATA_BLOB challenge_blob;
DATA_BLOB struct_blob = data_blob(NULL, 0);
unsigned int ref_count;
enum NTLMSSP_ROLE role;
enum server_types server_role;
- uint32 expected_state;
+ uint32_t expected_state;
BOOL unicode;
BOOL use_ntlmv2;
DATA_BLOB nt_resp;
DATA_BLOB session_key;
- uint32 neg_flags; /* the current state of negotiation with the NTLMSSP partner */
+ uint32_t neg_flags; /* the current state of negotiation with the NTLMSSP partner */
/* internal variables used by NTLM2 */
BOOL doing_ntlm2;
/* SMB Signing */
- uint32 ntlmssp_seq_num;
+ uint32_t ntlmssp_seq_num;
/* ntlmv2 */
char send_sign_key[16];
DATA_BLOB *b;
size_t head_ofs = 0;
uint16 len1, len2;
- uint32 ptr;
- uint32 *v;
+ uint32_t ptr;
+ uint32_t *v;
pstring p;
va_start(ap, format);
head_ofs += len1;
break;
case 'd':
- v = va_arg(ap, uint32 *);
+ v = va_arg(ap, uint32_t *);
NEED_DATA(4);
*v = IVAL(blob->data, head_ofs); head_ofs += 4;
break;
memcpy(sig->data + 12, seq_num, 4);
} else {
- uint32 crc;
+ uint32_t crc;
crc = crc32_calc_buffer((const char *)data, length);
if (!msrpc_gen(sig_mem_ctx, sig, "dddd", NTLMSSP_SIGN_VERSION, 0, crc, ntlmssp_state->ntlmssp_seq_num)) {
return NT_STATUS_NO_MEMORY;
memcpy(sig->data + 4, digest, 8);
memcpy(sig->data + 12, seq_num, 4);
} else {
- uint32 crc;
+ uint32_t crc;
crc = crc32_calc_buffer((const char *)data, length);
if (!msrpc_gen(sig_mem_ctx, sig, "dddd", NTLMSSP_SIGN_VERSION, 0, crc, ntlmssp_state->ntlmssp_seq_num)) {
return NT_STATUS_NO_MEMORY;
struct schannel_state {
TALLOC_CTX *mem_ctx;
uint8 session_key[16];
- uint32 seq_num;
+ uint32_t seq_num;
BOOL initiator;
DATA_BLOB signature;
};
/****************************************************************************
Map standard UNIX permissions onto wire representations.
****************************************************************************/
-static uint32 unix_perms_to_wire(mode_t perms)
+static uint32_t unix_perms_to_wire(mode_t perms)
{
unsigned int ret = 0;
****************************************************************************/
static NTSTATUS cli_unix_chmod_chown_internal(struct cli_tree *tree,
const char *fname,
- uint32 mode, uint32 uid,
- uint32 gid)
+ uint32_t mode, uint32_t uid,
+ uint32_t gid)
{
union smb_setfileinfo parms;
NTSTATUS status;
gid_t gid)
{
return cli_unix_chmod_chown_internal(tree, fname, SMB_MODE_NO_CHANGE,
- (uint32)uid, (uint32)gid);
+ (uint32_t)uid, (uint32_t)gid);
}
Used in CIFS-on-CIFS NTVFS.
****************************************************************************/
int cli_nt_create_full(struct cli_tree *tree, const char *fname,
- uint32 CreatFlags, uint32 DesiredAccess,
- uint32 FileAttributes, uint32 ShareAccess,
- uint32 CreateDisposition, uint32 CreateOptions,
+ uint32_t CreatFlags, uint32_t DesiredAccess,
+ uint32_t FileAttributes, uint32_t ShareAccess,
+ uint32_t CreateDisposition, uint32_t CreateOptions,
uint8 SecurityFlags)
{
union smb_open open_parms;
this is used for testing LOCKING_ANDX_CANCEL_LOCK
****************************************************************************/
NTSTATUS cli_locktype(struct cli_tree *tree, int fnum,
- uint32 offset, uint32 len, int timeout,
+ uint32_t offset, uint32_t len, int timeout,
unsigned char locktype)
{
union smb_lock parms;
Lock a file.
****************************************************************************/
NTSTATUS cli_lock(struct cli_tree *tree, int fnum,
- uint32 offset, uint32 len, int timeout,
+ uint32_t offset, uint32_t len, int timeout,
enum brl_type lock_type)
{
union smb_lock parms;
/****************************************************************************
Unlock a file.
****************************************************************************/
-NTSTATUS cli_unlock(struct cli_tree *tree, int fnum, uint32 offset, uint32 len)
+NTSTATUS cli_unlock(struct cli_tree *tree, int fnum, uint32_t offset, uint32_t len)
{
union smb_lock parms;
struct smb_lock_entry lock[1];
/*
* This function is not in the Heimdal mainline.
*/
- krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds)
+ krb5_error_code krb5_set_real_time(krb5_context context, int32_t_t seconds, int32_t_t microseconds)
{
krb5_error_code ret;
- int32_t sec, usec;
+ int32_t_t sec, usec;
ret = krb5_us_timeofday(context, &sec, &usec);
if (ret)
void ea_put_list(char *data, uint_t num_eas, struct ea_struct *eas)
{
int i;
- uint32 ea_size;
+ uint32_t ea_size;
ea_size = ea_list_size(num_eas, eas);
uint_t *num_eas, struct ea_struct **eas)
{
int n;
- uint32 ea_size, ofs;
+ uint32_t ea_size, ofs;
if (blob->length < 4) {
return NT_STATUS_INFO_LENGTH_MISMATCH;
{
struct smb_nttrans nt;
NTSTATUS status;
- uint32 ofs, i;
+ uint32_t ofs, i;
struct cli_session *session = req?req->session:NULL;
status = smb_raw_nttrans_recv(req, mem_ctx, &nt);
/* count them */
for (ofs=0; nt.out.params.length - ofs > 12; ) {
- uint32 next = IVAL(nt.out.params.data, ofs);
+ uint32_t next = IVAL(nt.out.params.data, ofs);
parms->out.num_changes++;
if (next == 0 ||
ofs + next >= nt.out.params.length) break;
{
struct cli_request *req;
uint16 flags2;
- uint32 capabilities;
+ uint32_t capabilities;
req = cli_request_setup_transport(session->transport, command, wct, buflen);
/* check that a lump of data in a request is within the bounds of the data section of
the packet */
-static BOOL cli_req_data_oob(struct cli_request *req, const char *ptr, uint32 count)
+static BOOL cli_req_data_oob(struct cli_request *req, const char *ptr, uint32_t count)
{
/* be careful with wraparound! */
if (ptr < req->in.data ||
TALLOC_CTX *mem_ctx,
struct smb_nttrans *parms)
{
- uint32 total_data, recvd_data=0;
- uint32 total_param, recvd_param=0;
+ uint32_t total_data, recvd_data=0;
+ uint32_t total_param, recvd_param=0;
if (!cli_request_receive(req) ||
cli_request_is_error(req)) {
while (recvd_data < total_data ||
recvd_param < total_param) {
- uint32 param_count, param_ofs, param_disp;
- uint32 data_count, data_ofs, data_disp;
- uint32 total_data2, total_param2;
+ uint32_t param_count, param_ofs, param_disp;
+ uint32_t data_count, data_ofs, data_disp;
+ uint32_t total_data2, total_param2;
/* parse out the total lengths again - they can shrink! */
total_param2 = IVAL(req->in.vwv, 3);
struct smb_basic_signing_context {
DATA_BLOB mac_key;
- uint32 next_seq_num;
+ uint32_t next_seq_num;
};
/***********************************************************
/* Return the DOS error from the last packet - an error class and an error
code. */
-void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode)
+void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32_t *ecode)
{
if (cli->transport->error.etype == ETYPE_DOS) {
ntstatus_to_dos(cli->transport->error.e.nt_status,
return NULL;
}
- ret->sub_auths = talloc_array_p(mem_ctx, uint32, num_sub_auths);
+ ret->sub_auths = talloc_array_p(mem_ctx, uint32_t, num_sub_auths);
if (!ret->sub_auths) {
return NULL;
}
/* NT status -> dos error map */
static const struct {
uint8 dos_class;
- uint32 dos_code;
+ uint32_t dos_code;
NTSTATUS ntstatus;
} ntstatus_to_dos_map[] = {
{ERRDOS, ERRgeneral, NT_STATUS_UNSUCCESSFUL},
/* dos -> nt status error map */
static const struct {
uint8 dos_class;
- uint32 dos_code;
+ uint32_t dos_code;
NTSTATUS ntstatus;
} dos_to_ntstatus_map[] = {
{ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED},
/*****************************************************************************
convert a dos eclas/ecode to a NT status32 code
*****************************************************************************/
-NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode)
+NTSTATUS dos_to_ntstatus(uint8 eclass, uint32_t ecode)
{
int i;
if (eclass == 0 && ecode == 0) return NT_STATUS_OK;
/*****************************************************************************
convert a NT status code to a dos class/code
*****************************************************************************/
-void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode)
+void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32_t *ecode)
{
int i;
if (NT_STATUS_IS_OK(ntstatus)) {
returned password including termination.
************************************************************/
BOOL decode_pw_buffer(char in_buffer[516], char *new_pwrd,
- int new_pwrd_size, uint32 *new_pw_len,
+ int new_pwrd_size, uint32_t *new_pw_len,
int string_flags)
{
int byte_len=0;
} dcerpc_syntax_id_p;
typedef struct {
- unsigned32 count;
+ uint32 count;
[size_is(count)] dcerpc_syntax_id_p if_id[*];
} rpc_if_id_vector_t;
/* offset lists are used to allow a push/pull function to find the
start of an encapsulating structure */
struct ndr_ofs_list {
- uint32 offset;
+ uint32_t offset;
struct ndr_ofs_list *next;
};
particular transport
*/
struct ndr_pull {
- uint32 flags; /* LIBNDR_FLAG_* */
+ uint32_t flags; /* LIBNDR_FLAG_* */
char *data;
- uint32 data_size;
- uint32 offset;
+ uint32_t data_size;
+ uint32_t offset;
TALLOC_CTX *mem_ctx;
/* this points at a list of offsets to the structures being processed.
};
struct ndr_pull_save {
- uint32 data_size;
- uint32 offset;
+ uint32_t data_size;
+ uint32_t offset;
struct ndr_pull_save *next;
};
/* structure passed to functions that generate NDR formatted data */
struct ndr_push {
- uint32 flags; /* LIBNDR_FLAG_* */
+ uint32_t flags; /* LIBNDR_FLAG_* */
char *data;
- uint32 alloc_size;
- uint32 offset;
+ uint32_t alloc_size;
+ uint32_t offset;
TALLOC_CTX *mem_ctx;
/* this is used to ensure we generate unique reference IDs */
- uint32 ptr_count;
+ uint32_t ptr_count;
/* this points at a list of offsets to the structures being processed.
The first element in the list is the current structure */
};
struct ndr_push_save {
- uint32 offset;
+ uint32_t offset;
struct ndr_push_save *next;
};
/* structure passed to functions that print IDL structures */
struct ndr_print {
- uint32 flags; /* LIBNDR_FLAG_* */
+ uint32_t flags; /* LIBNDR_FLAG_* */
TALLOC_CTX *mem_ctx;
- uint32 depth;
+ uint32_t depth;
void (*print)(struct ndr_print *, const char *, ...);
void *private;
};
#define NDR_PUSH_ALIGN(ndr, n) do { \
if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) { \
- uint32 _pad = ((ndr->offset + (n-1)) & ~(n-1)) - ndr->offset; \
+ uint32_t _pad = ((ndr->offset + (n-1)) & ~(n-1)) - ndr->offset; \
while (_pad--) NDR_CHECK(ndr_push_uint8(ndr, 0)); \
} \
} while(0)
typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void *);
typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, const void *);
typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *);
-typedef NTSTATUS (*ndr_push_union_fn_t)(struct ndr_push *, int ndr_flags, uint32, void *);
-typedef NTSTATUS (*ndr_pull_union_fn_t)(struct ndr_pull *, int ndr_flags, uint32, void *);
+typedef NTSTATUS (*ndr_push_union_fn_t)(struct ndr_push *, int ndr_flags, uint32_t, void *);
+typedef NTSTATUS (*ndr_pull_union_fn_t)(struct ndr_pull *, int ndr_flags, uint32_t, void *);
typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *);
typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, void *);
-typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint32, void *);
+typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint32_t, void *);
#include "librpc/ndr/ndr_basic.h"
#include "librpc/ndr/ndr_sec.h"
/*
work out the number of bytes needed to align on a n byte boundary
*/
-size_t ndr_align_size(uint32 offset, size_t n)
+size_t ndr_align_size(uint32_t offset, size_t n)
{
if ((offset & (n-1)) == 0) return 0;
return n - (offset & (n-1));
create an ndr sub-context based on an existing context. The new context starts
at the current offset, with the given size limit
*/
-NTSTATUS ndr_pull_subcontext(struct ndr_pull *ndr, struct ndr_pull *ndr2, uint32 size)
+NTSTATUS ndr_pull_subcontext(struct ndr_pull *ndr, struct ndr_pull *ndr2, uint32_t size)
{
NDR_PULL_NEED_BYTES(ndr, size);
*ndr2 = *ndr;
/*
advance by 'size' bytes
*/
-NTSTATUS ndr_pull_advance(struct ndr_pull *ndr, uint32 size)
+NTSTATUS ndr_pull_advance(struct ndr_pull *ndr, uint32_t size)
{
ndr->offset += size;
if (ndr->offset > ndr->data_size) {
/*
set the parse offset to 'ofs'
*/
-NTSTATUS ndr_pull_set_offset(struct ndr_pull *ndr, uint32 ofs)
+NTSTATUS ndr_pull_set_offset(struct ndr_pull *ndr, uint32_t ofs)
{
ndr->offset = ofs;
if (ndr->offset > ndr->data_size) {
/*
expand the available space in the buffer to 'size'
*/
-NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32 size)
+NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32_t size)
{
if (ndr->alloc_size >= size) {
return NT_STATUS_OK;
/*
set the push offset to 'ofs'
*/
-NTSTATUS ndr_push_set_offset(struct ndr_push *ndr, uint32 ofs)
+NTSTATUS ndr_push_set_offset(struct ndr_push *ndr, uint32_t ofs)
{
NDR_CHECK(ndr_push_expand(ndr, ofs));
ndr->offset = ofs;
push a generic array
*/
NTSTATUS ndr_push_array(struct ndr_push *ndr, int ndr_flags, void *base,
- size_t elsize, uint32 count,
+ size_t elsize, uint32_t count,
NTSTATUS (*push_fn)(struct ndr_push *, int, void *))
{
int i;
pull a constant sized array
*/
NTSTATUS ndr_pull_array(struct ndr_pull *ndr, int ndr_flags, void *base,
- size_t elsize, uint32 count,
+ size_t elsize, uint32_t count,
NTSTATUS (*pull_fn)(struct ndr_pull *, int, void *))
{
int i;
print a generic array
*/
void ndr_print_array(struct ndr_print *ndr, const char *name, void *base,
- size_t elsize, uint32 count,
+ size_t elsize, uint32_t count,
void (*print_fn)(struct ndr_print *, const char *, void *))
{
int i;
/*
a useful helper function for printing idl unions via DEBUG()
*/
-void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint32, void *),
+void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint32_t, void *),
const char *name,
- uint32 level,
+ uint32_t level,
void *ptr)
{
struct ndr_print ndr;
{
switch (sub_size) {
case 0: {
- uint32 size = ndr->data_size - ndr->offset;
+ uint32_t size = ndr->data_size - ndr->offset;
if (size == 0) return NT_STATUS_OK;
NDR_CHECK(ndr_pull_subcontext(ndr, ndr2, size));
break;
}
case 4: {
- uint32 size;
+ uint32_t size;
NDR_CHECK(ndr_pull_uint32(ndr, &size));
if (size == 0) return NT_STATUS_OK;
NDR_CHECK(ndr_pull_subcontext(ndr, ndr2, size));
NTSTATUS ndr_pull_subcontext_union_fn(struct ndr_pull *ndr,
size_t sub_size,
- uint32 level,
+ uint32_t level,
void *base,
- NTSTATUS (*fn)(struct ndr_pull *, int , uint32 , void *))
+ NTSTATUS (*fn)(struct ndr_pull *, int , uint32_t , void *))
{
struct ndr_pull ndr2;
*/
NTSTATUS ndr_push_subcontext_union_fn(struct ndr_push *ndr,
size_t sub_size,
- uint32 level,
+ uint32_t level,
void *base,
- NTSTATUS (*fn)(struct ndr_push *, int, uint32, void *))
+ NTSTATUS (*fn)(struct ndr_push *, int, uint32_t, void *))
{
struct ndr_push *ndr2;
NTSTATUS (*fn)(struct ndr_pull *, int ndr_flags, void *))
{
struct ndr_pull ndr2;
- uint32 ofs;
+ uint32_t ofs;
struct ndr_pull_save save;
void *p;
/*
pull a union from a blob using NDR
*/
-NTSTATUS ndr_pull_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, uint32 level, void *p,
- NTSTATUS (*fn)(struct ndr_pull *, int ndr_flags, uint32, void *))
+NTSTATUS ndr_pull_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, uint32_t level, void *p,
+ NTSTATUS (*fn)(struct ndr_pull *, int ndr_flags, uint32_t, void *))
{
struct ndr_pull *ndr;
ndr = ndr_pull_init_blob(blob, mem_ctx);
/*
- parse a uint32
+ parse a uint32_t
*/
-NTSTATUS ndr_pull_uint32(struct ndr_pull *ndr, uint32 *v)
+NTSTATUS ndr_pull_uint32(struct ndr_pull *ndr, uint32_t *v)
{
NDR_PULL_ALIGN(ndr, 4);
NDR_PULL_NEED_BYTES(ndr, 4);
*/
NTSTATUS ndr_pull_NTSTATUS(struct ndr_pull *ndr, NTSTATUS *status)
{
- uint32 v;
+ uint32_t v;
NDR_CHECK(ndr_pull_uint32(ndr, &v));
*status = NT_STATUS(v);
return NT_STATUS_OK;
*/
NTSTATUS ndr_pull_WERROR(struct ndr_pull *ndr, WERROR *status)
{
- uint32 v;
+ uint32_t v;
NDR_CHECK(ndr_pull_uint32(ndr, &v));
*status = W_ERROR(v);
return NT_STATUS_OK;
/*
parse a set of bytes
*/
-NTSTATUS ndr_pull_bytes(struct ndr_pull *ndr, char *data, uint32 n)
+NTSTATUS ndr_pull_bytes(struct ndr_pull *ndr, char *data, uint32_t n)
{
NDR_PULL_NEED_BYTES(ndr, n);
memcpy(data, ndr->data + ndr->offset, n);
/*
pull an array of uint8
*/
-NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, char *data, uint32 n)
+NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, char *data, uint32_t n)
{
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
/*
pull an array of uint16
*/
-NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, int ndr_flags, uint16 *data, uint32 n)
+NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, int ndr_flags, uint16 *data, uint32_t n)
{
- uint32 i;
+ uint32_t i;
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
}
}
/*
- pull a const array of uint32
+ pull a const array of uint32_t
*/
-NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32 *data, uint32 n)
+NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *data, uint32_t n)
{
- uint32 i;
+ uint32_t i;
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
}
}
/*
- push a uint32
+ push a uint32_t
*/
-NTSTATUS ndr_push_uint32(struct ndr_push *ndr, uint32 v)
+NTSTATUS ndr_push_uint32(struct ndr_push *ndr, uint32_t v)
{
NDR_PUSH_ALIGN(ndr, 4);
NDR_PUSH_NEED_BYTES(ndr, 4);
/*
push some bytes
*/
-NTSTATUS ndr_push_bytes(struct ndr_push *ndr, const char *data, uint32 n)
+NTSTATUS ndr_push_bytes(struct ndr_push *ndr, const char *data, uint32_t n)
{
NDR_PUSH_NEED_BYTES(ndr, n);
memcpy(ndr->data + ndr->offset, data, n);
/*
push some zero bytes
*/
-NTSTATUS ndr_push_zero(struct ndr_push *ndr, uint32 n)
+NTSTATUS ndr_push_zero(struct ndr_push *ndr, uint32_t n)
{
NDR_PUSH_NEED_BYTES(ndr, n);
memset(ndr->data + ndr->offset, 0, n);
/*
push an array of uint8
*/
-NTSTATUS ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const char *data, uint32 n)
+NTSTATUS ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const char *data, uint32_t n)
{
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
/*
push an array of uint16
*/
-NTSTATUS ndr_push_array_uint16(struct ndr_push *ndr, int ndr_flags, const uint16 *data, uint32 n)
+NTSTATUS ndr_push_array_uint16(struct ndr_push *ndr, int ndr_flags, const uint16 *data, uint32_t n)
{
int i;
if (!(ndr_flags & NDR_SCALARS)) {
}
/*
- push an array of uint32
+ push an array of uint32_t
*/
-NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, int ndr_flags, const uint32 *data, uint32 n)
+NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, int ndr_flags, const uint32_t *data, uint32_t n)
{
int i;
if (!(ndr_flags & NDR_SCALARS)) {
*/
NTSTATUS ndr_push_ptr(struct ndr_push *ndr, const void *p)
{
- uint32 ptr = 0;
+ uint32_t ptr = 0;
if (p) {
/* we do this to ensure that we generate unique ref ids,
which means we can handle the case where a MS programmer
NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s)
{
char *as=NULL;
- uint32 len1, ofs, len2;
+ uint32_t len1, ofs, len2;
uint16 len3;
int ret;
int chset = CH_UCS2;
*/
NTSTATUS ndr_pull_time_t(struct ndr_pull *ndr, time_t *t)
{
- uint32 tt;
+ uint32_t tt;
NDR_CHECK(ndr_pull_uint32(ndr, &tt));
*t = tt;
return NT_STATUS_OK;
ndr->print(ndr, "%-25s: 0x%04x (%u)", name, v, v);
}
-void ndr_print_uint32(struct ndr_print *ndr, const char *name, uint32 v)
+void ndr_print_uint32(struct ndr_print *ndr, const char *name, uint32_t v)
{
ndr->print(ndr, "%-25s: 0x%08x (%u)", name, v, v);
}
void ndr_print_uint64(struct ndr_print *ndr, const char *name, uint64 v)
{
- ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32)(v >> 32), (uint32)(v & 0xFFFFFFFF));
+ ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32_t)(v >> 32), (uint32_t)(v & 0xFFFFFFFF));
}
void ndr_print_int64(struct ndr_print *ndr, const char *name, int64 v)
{
ndr->print(ndr, "%-25s: 0x%08x%08x (%lld)", name,
- (uint32)(v >> 32),
- (uint32)(v & 0xFFFFFFFF),
+ (uint32_t)(v >> 32),
+ (uint32_t)(v & 0xFFFFFFFF),
v);
}
void ndr_print_HYPER_T(struct ndr_print *ndr, const char *name, HYPER_T v)
{
- ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32)(v >> 32), (uint32)(v & 0xFFFFFFFF));
+ ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32_t)(v >> 32), (uint32_t)(v & 0xFFFFFFFF));
}
void ndr_print_ptr(struct ndr_print *ndr, const char *name, const void *p)
}
void ndr_print_array_uint32(struct ndr_print *ndr, const char *name,
- const uint32 *data, uint32 count)
+ const uint32_t *data, uint32_t count)
{
int i;
}
void ndr_print_array_uint16(struct ndr_print *ndr, const char *name,
- const uint16 *data, uint32 count)
+ const uint16 *data, uint32_t count)
{
int i;
}
void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
- const uint8 *data, uint32 count)
+ const uint8 *data, uint32_t count)
{
int i;
*/
NTSTATUS GUID_from_string(const char *s, struct GUID *guid)
{
- uint32 time_low;
- uint32 time_mid, time_hi_and_version;
- uint32 clock_seq[2];
- uint32 node[6];
+ uint32_t time_low;
+ uint32_t time_mid, time_hi_and_version;
+ uint32_t clock_seq[2];
+ uint32_t node[6];
int i;
if (11 != sscanf(s, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
*/
NTSTATUS ndr_pull_DATA_BLOB(struct ndr_pull *ndr, DATA_BLOB *blob)
{
- uint32 length;
+ uint32_t length;
if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
*/
NTSTATUS ndr_pull_dom_sid2(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid)
{
- uint32 num_auths;
+ uint32_t num_auths;
if (!(ndr_flags & NDR_SCALARS)) {
return NT_STATUS_OK;
}
char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
{
int i, ofs, maxlen;
- uint32 ia;
+ uint32_t ia;
char *ret;
if (!sid) {
*/
struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
- uint32 rid)
+ uint32_t rid)
{
struct dom_sid *sid;
if (!sid) return NULL;
*sid = *domain_sid;
- sid->sub_auths = talloc_array_p(mem_ctx, uint32, sid->num_auths+1);
+ sid->sub_auths = talloc_array_p(mem_ctx, uint32_t, sid->num_auths+1);
if (!sid->sub_auths) {
return NULL;
}
- memcpy(sid->sub_auths, domain_sid->sub_auths, sid->num_auths*sizeof(uint32));
+ memcpy(sid->sub_auths, domain_sid->sub_auths, sid->num_auths*sizeof(uint32_t));
sid->sub_auths[sid->num_auths] = rid;
sid->num_auths++;
return sid;
struct smb_query_secdesc {
struct {
uint16 fnum;
- uint32 secinfo_flags;
+ uint32_t secinfo_flags;
} in;
struct {
struct security_descriptor *sd;
struct smb_set_secdesc {
struct {
uint16 fnum;
- uint32 secinfo_flags;
+ uint32_t secinfo_flags;
struct security_descriptor *sd;
} in;
};
#include "includes.h"
NTSTATUS pull_spoolss_PrinterInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- uint32 level, uint32 count,
+ uint32_t level, uint32_t count,
union spoolss_PrinterInfo **info)
{
int i;
}
NTSTATUS pull_spoolss_FormInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- uint32 level, uint32 count,
+ uint32_t level, uint32_t count,
union spoolss_FormInfo **info)
{
int i;
}
NTSTATUS pull_spoolss_JobInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- uint32 level, uint32 count,
+ uint32_t level, uint32_t count,
union spoolss_JobInfo **info)
{
int i;
}
NTSTATUS pull_spoolss_DriverInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- uint32 level, uint32 count,
+ uint32_t level, uint32_t count,
union spoolss_DriverInfo **info)
{
int i;
struct dcerpc_packet pkt;
NTSTATUS status;
DATA_BLOB blob, payload;
- uint32 remaining, chunk_size;
+ uint32_t remaining, chunk_size;
/* allow the application to tell when a fault has happened */
p->last_fault_code = 0;
/* continue receiving fragments */
while (!(pkt.pfc_flags & DCERPC_PFC_FLAG_LAST)) {
- uint32 length;
+ uint32_t length;
status = p->transport.secondary_request(p, mem_ctx, &blob);
if (!NT_STATUS_IS_OK(status)) {
standard format
*/
NTSTATUS dcerpc_ndr_request(struct dcerpc_pipe *p,
- uint32 opnum,
+ uint32_t opnum,
TALLOC_CTX *mem_ctx,
NTSTATUS (*ndr_push)(struct ndr_push *, int, void *),
NTSTATUS (*ndr_pull)(struct ndr_pull *, int, void *),
struct dcerpc_pipe {
TALLOC_CTX *mem_ctx;
int reference_count;
- uint32 call_id;
- uint32 srv_max_xmit_frag;
- uint32 srv_max_recv_frag;
+ uint32_t call_id;
+ uint32_t srv_max_xmit_frag;
+ uint32_t srv_max_recv_frag;
unsigned flags;
struct dcerpc_security *security_state;
struct dcerpc_auth *auth_info;
} transport;
/* the last fault code from a DCERPC fault */
- uint32 last_fault_code;
+ uint32_t last_fault_code;
};
/* dcerpc pipe flags */
};
struct dcerpc_endpoint_list {
- uint32 count;
+ uint32_t count;
const char * const *names;
};
struct dcerpc_interface_table {
const char *name;
const char *uuid;
- uint32 if_version;
- uint32 num_calls;
+ uint32_t if_version;
+ uint32_t num_calls;
const struct dcerpc_interface_call *calls;
const struct dcerpc_endpoint_list *endpoints;
};
enum dcerpc_transport_t transport;
const char *host;
const char **options;
- uint32 flags;
+ uint32_t flags;
};
uint8 mach_pwd[16];
struct creds_CredentialState creds;
const char *workgroup, *workstation;
- uint32 negotiate_flags = 0;
+ uint32_t negotiate_flags = 0;
workstation = username;
workgroup = domain;
/* the rest of the data is available via SMBreadX */
while (frag_length > payload.length) {
- uint32 n;
+ uint32_t n;
union smb_read io;
n = frag_length - payload.length;
{
struct smb_private *smb = p->transport.private;
union smb_read io;
- uint32 n = 0x2000;
- uint32 frag_length;
+ uint32_t n = 0x2000;
+ uint32_t frag_length;
NTSTATUS status;
*blob = data_blob_talloc(mem_ctx, NULL, n);
struct tcp_private {
int fd;
char *server_name;
- uint32 port;
+ uint32_t port;
};
{
struct tcp_private *tcp = p->transport.private;
ssize_t ret;
- uint32 frag_length;
+ uint32_t frag_length;
DATA_BLOB blob1;
blob1 = data_blob_talloc(mem_ctx, NULL, 16);
*/
NTSTATUS dcerpc_pipe_open_tcp(struct dcerpc_pipe **p,
const char *server,
- uint32 port)
+ uint32_t port)
{
struct tcp_private *tcp;
int fd;
*/
NTSTATUS dcerpc_epm_map_tcp_port(const char *server,
const char *uuid, unsigned version,
- uint32 *port)
+ uint32_t *port)
{
struct dcerpc_pipe *p;
NTSTATUS status;
/*
find the pipe name for a local IDL interface
*/
-const char *idl_pipe_name(const char *uuid, uint32 if_version)
+const char *idl_pipe_name(const char *uuid, uint32_t if_version)
{
int i;
for (i=0;dcerpc_pipes[i];i++) {
/*
find the number of calls defined by local IDL
*/
-int idl_num_calls(const char *uuid, uint32 if_version)
+int idl_num_calls(const char *uuid, uint32_t if_version)
{
int i;
for (i=0;dcerpc_pipes[i];i++) {
static const struct {
const char *name;
- uint32 flag;
+ uint32_t flag;
} ncacn_options[] = {
{"sign", DCERPC_SIGN},
{"seal", DCERPC_SEAL},
static NTSTATUS dcerpc_pipe_connect_ncacn_np(struct dcerpc_pipe **p,
struct dcerpc_binding *binding,
const char *pipe_uuid,
- uint32 pipe_version,
+ uint32_t pipe_version,
const char *domain,
const char *username,
const char *password)
static NTSTATUS dcerpc_pipe_connect_ncacn_ip_tcp(struct dcerpc_pipe **p,
struct dcerpc_binding *binding,
const char *pipe_uuid,
- uint32 pipe_version,
+ uint32_t pipe_version,
const char *domain,
const char *username,
const char *password)
{
NTSTATUS status;
- uint32 port = 0;
+ uint32_t port = 0;
if (binding->options && binding->options[0]) {
port = atoi(binding->options[0]);
NTSTATUS dcerpc_pipe_connect_b(struct dcerpc_pipe **p,
struct dcerpc_binding *binding,
const char *pipe_uuid,
- uint32 pipe_version,
+ uint32_t pipe_version,
const char *domain,
const char *username,
const char *password)
NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **p,
const char *binding,
const char *pipe_uuid,
- uint32 pipe_version,
+ uint32_t pipe_version,
const char *domain,
const char *username,
const char *password)
NTSTATUS dcerpc_secondary_smb(struct dcerpc_pipe *p, struct dcerpc_pipe **p2,
const char *pipe_name,
const char *pipe_uuid,
- uint32 pipe_version)
+ uint32_t pipe_version)
{
NTSTATUS status;
struct cli_tree *tree;
static uint16 find_next_fnum(struct ipc_private *ipc)
{
struct pipe_state *p;
- uint32 ret;
+ uint32_t ret;
if (ipc->num_open == 0xFFFF) {
return 0;
/*
convert a unix stat struct to a dos attrib
*/
-uint32 svfs_file_attrib(struct stat *st)
+uint32_t svfs_file_attrib(struct stat *st)
{
if (S_ISDIR(st->st_mode)) {
return FILE_ATTRIBUTE_DIRECTORY;
static uid_t winbind_uid_low, winbind_uid_high;
static gid_t winbind_gid_low, winbind_gid_high;
-static uint32 non_unix_account_low, non_unix_account_high;
+static uint32_t non_unix_account_low, non_unix_account_high;
BOOL lp_winbind_uid(uid_t *low, uid_t *high)
{
return True;
}
-BOOL lp_non_unix_account_range(uint32 *low, uint32 *high)
+BOOL lp_non_unix_account_range(uint32_t *low, uint32_t *high)
{
if (non_unix_account_low == 0 || non_unix_account_high == 0)
return False;
static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr)
{
- uint32 low, high;
+ uint32_t low, high;
if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low)
return False;
static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr)
{
- uint32 low, high;
+ uint32_t low, high;
if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low)
return False;
static BOOL handle_non_unix_account_range(const char *pszParmValue, char **ptr)
{
- uint32 low, high;
+ uint32_t low, high;
if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low)
return False;
*/
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
+uint32_t dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
{
return 500;
}
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
+uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
{
return 5;
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
+uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
{
return 2;
}
*/
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_count_of_shares(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
+uint32_t dcesrv_common_get_count_of_shares(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
{
- /* what's about int -> uint32 overflow */
+ /* what's about int -> uint32_t overflow */
return lp_numservices();
}
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_share_permissions(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
+uint32_t dcesrv_common_get_share_permissions(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
{
return 0;
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_share_max_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
+uint32_t dcesrv_common_get_share_max_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
{
return 10;
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_share_current_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
+uint32_t dcesrv_common_get_share_current_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
{
return 1;
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
+uint32_t dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
{
/* for disk share 0x00000000
* for print share 0x00000001
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_share_csc_policy(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
+uint32_t dcesrv_common_get_share_csc_policy(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
{
return 0;
}
/* This hardcoded value should go into a ldb database! */
-uint32 dcesrv_common_get_share_unknown(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
+uint32_t dcesrv_common_get_share_unknown(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
{
return 0;
}
see if a uuid and if_version match to an interface
*/
static BOOL interface_match_by_uuid(const struct dcesrv_interface *iface,
- const char *uuid, uint32 if_version)
+ const char *uuid, uint32_t if_version)
{
if (iface->ndr->if_version != if_version) {
return False;
find the interface operations on an endpoint by uuid
*/
static const struct dcesrv_interface *find_interface_by_uuid(const struct dcesrv_endpoint *endpoint,
- const char *uuid, uint32 if_version)
+ const char *uuid, uint32_t if_version)
{
struct dcesrv_if_list *ifl;
for (ifl=endpoint->interface_list; ifl; ifl=ifl->next) {
/*
return a dcerpc fault
*/
-static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32 fault_code)
+static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32_t fault_code)
{
struct dcerpc_packet pkt;
struct dcesrv_call_reply *rep;
/*
return a dcerpc bind_nak
*/
-static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32 reason)
+static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32_t reason)
{
struct dcerpc_packet pkt;
struct dcesrv_call_reply *rep;
static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
{
const char *uuid, *transfer_syntax;
- uint32 if_version, transfer_syntax_version;
+ uint32_t if_version, transfer_syntax_version;
struct dcerpc_packet pkt;
struct dcesrv_call_reply *rep;
NTSTATUS status;
- uint32 result=0, reason=0;
+ uint32_t result=0, reason=0;
if (call->pkt.u.bind.num_contexts != 1 ||
call->pkt.u.bind.ctx_list[0].num_transfer_syntaxes < 1) {
void *r;
NTSTATUS status;
DATA_BLOB stub;
- uint32 total_length;
+ uint32_t total_length;
if (!call->conn->iface) {
total_length = stub.length;
do {
- uint32 length;
+ uint32_t length;
struct dcesrv_call_reply *rep;
struct dcerpc_packet pkt;
/*
we might have consumed only part of our input - advance past that part
*/
-static void dce_partial_advance(struct dcesrv_connection *dce_conn, uint32 offset)
+static void dce_partial_advance(struct dcesrv_connection *dce_conn, uint32_t offset)
{
DATA_BLOB blob;
/* see if this is a continued packet */
if (!(call->pkt.pfc_flags & DCERPC_PFC_FLAG_FIRST)) {
struct dcesrv_call_state *call2 = call;
- uint32 alloc_size;
+ uint32_t alloc_size;
/* we only allow fragmented requests, no other packet types */
if (call->pkt.ptype != DCERPC_PKT_REQUEST) {
enum endpoint_type type;
union {
const char *smb_pipe;
- uint32 tcp_port;
+ uint32_t tcp_port;
} info;
};
} *replies;
/* this is used by the boilerplate code to generate DCERPC faults */
- uint32 fault_code;
+ uint32_t fault_code;
};
#define DCESRV_HANDLE_ANY 255
struct dcesrv_call_state *call_list;
/* the maximum size the client wants to receive */
- uint32 cli_max_recv_frag;
+ uint32_t cli_max_recv_frag;
/* private data for the interface implementation */
void *private;
* ask for a dcesrv_interface implementation
* - iface must be referenz to an allready existent struct !
*/
- BOOL (*interface_by_uuid)(struct dcesrv_interface *iface, const char *, uint32);
+ BOOL (*interface_by_uuid)(struct dcesrv_interface *iface, const char *, uint32_t);
/* this function can be used by other endpoint servers to
* ask for a dcesrv_interface implementation
*/
static void setup_listen_rpc(struct event_context *events,
const struct model_ops *model_ops,
- struct in_addr *ifip, uint32 *port,
+ struct in_addr *ifip, uint32_t *port,
struct rpc_server_context *r,
const struct dcesrv_endpoint *endpoint)
{
const char *name;
struct dcesrv_ep_description ep_description;
const char *uuid;
- uint32 if_version;
+ uint32_t if_version;
};
/*
/*
build a list of all interfaces handled by all endpoint servers
*/
-static uint32 build_ep_list(TALLOC_CTX *mem_ctx,
+static uint32_t build_ep_list(TALLOC_CTX *mem_ctx,
struct dcesrv_endpoint *endpoint_list,
struct dcesrv_ep_iface **eps)
{
struct dcesrv_endpoint *d;
- uint32 total = 0;
+ uint32_t total = 0;
(*eps) = NULL;
{
struct dcesrv_handle *h;
struct rpc_eps {
- uint32 count;
+ uint32_t count;
struct dcesrv_ep_iface *e;
} *eps;
- uint32 num_ents;
+ uint32_t num_ents;
int i;
h = dcesrv_handle_fetch(dce_call->conn, r->in.entry_handle, HTYPE_LOOKUP);
static NTSTATUS epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct epm_Map *r)
{
- uint32 count;
+ uint32_t count;
int i;
struct dcesrv_ep_iface *eps;
struct epm_floor *floors;
BOOL authenticated;
char *account_name;
char *computer_name; /* for logging only */
- uint32 acct_flags;
+ uint32_t acct_flags;
uint16 sec_chan_type;
struct creds_CredentialState *creds;
};
const char *account_name,
const char *computer_name,
uint16 secure_channel_type,
- uint32 in_flags,
+ uint32_t in_flags,
const struct netr_Credential *client_credentials,
struct netr_Credential *server_credentials,
- uint32 *out_flags)
+ uint32_t *out_flags)
{
void *sam_ctx;
uint8 *mach_pwd;
return True;
}
-static BOOL remote_op_interface_by_uuid(struct dcesrv_interface *iface, const char *uuid, uint32 if_version)
+static BOOL remote_op_interface_by_uuid(struct dcesrv_interface *iface, const char *uuid, uint32_t if_version)
{
int i;
struct dcesrv_handle *h;
const char *name;
struct ldb_message msg;
- uint32 rid;
+ uint32_t rid;
const char *groupname, *sidstr;
time_t now = time(NULL);
TALLOC_CTX *mem_ctx2;
struct dcesrv_handle *h;
const char *name;
struct ldb_message msg;
- uint32 rid;
+ uint32_t rid;
const char *username, *sidstr;
time_t now = time(NULL);
TALLOC_CTX *mem_ctx2;
struct samr_CreateUser *r)
{
struct samr_CreateUser2 r2;
- uint32 access_granted;
+ uint32_t access_granted;
/* a simple wrapper around samr_CreateUser2 works nicely */
return NT_STATUS_OK;
}
- r->out.rids.ids = talloc_array_p(mem_ctx, uint32, r->in.num_names);
- r->out.types.ids = talloc_array_p(mem_ctx, uint32, r->in.num_names);
+ r->out.rids.ids = talloc_array_p(mem_ctx, uint32_t, r->in.num_names);
+ r->out.types.ids = talloc_array_p(mem_ctx, uint32_t, r->in.num_names);
if (!r->out.rids.ids || !r->out.types.ids) {
return NT_STATUS_NO_MEMORY;
}
struct ldb_message **res;
struct dom_sid2 *sid;
const char *sidstr;
- uint32 atype, rtype;
+ uint32_t atype, rtype;
r->out.rids.ids[i] = 0;
r->out.types.ids[i] = SID_NAME_UNKNOWN;
int reference_count;
void *sam_ctx;
TALLOC_CTX *mem_ctx;
- uint32 access_mask;
+ uint32_t access_mask;
};
/*
int reference_count;
void *sam_ctx;
TALLOC_CTX *mem_ctx;
- uint32 access_mask;
+ uint32_t access_mask;
const char *domain_sid;
const char *domain_name;
const char *domain_dn;
struct samr_domain_state *domain_state;
void *sam_ctx;
TALLOC_CTX *mem_ctx;
- uint32 access_mask;
+ uint32_t access_mask;
const char *account_sid;
const char *account_name;
const char *account_dn;
/*
pull a rid from a objectSid in a result set.
*/
-uint32 samdb_result_rid_from_sid(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
- const char *attr, uint32 default_value)
+uint32_t samdb_result_rid_from_sid(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
+ const char *attr, uint32_t default_value)
{
struct dom_sid *sid;
const char *sidstr = ldb_msg_find_string(msg, attr, NULL);
return 0 on failure, the id on success
*/
static NTSTATUS _samdb_allocate_next_id(void *ctx, TALLOC_CTX *mem_ctx, const char *dn,
- const char *attr, uint32 *id)
+ const char *attr, uint32_t *id)
{
struct samdb_context *sam_ctx = ctx;
struct ldb_message msg;
return 0 on failure, the id on success
*/
NTSTATUS samdb_allocate_next_id(void *ctx, TALLOC_CTX *mem_ctx, const char *dn, const char *attr,
- uint32 *id)
+ uint32_t *id)
{
int tries = 10;
NTSTATUS status;
add a acct_flags element to a message
*/
int samdb_msg_add_acct_flags(void *ctx, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
- const char *attr_name, uint32 v)
+ const char *attr_name, uint32_t v)
{
return samdb_msg_add_uint(ctx, mem_ctx, msg, attr_name, samdb_acb2uf(v));
}
{
NTSTATUS status;
char new_pass[512];
- uint32 new_pass_len;
+ uint32_t new_pass_len;
struct samr_CryptPassword *pwbuf = r->in.password;
void *sam_ctx;
const char *user_dn, *domain_dn;
{
NTSTATUS status;
char new_pass[512];
- uint32 new_pass_len;
+ uint32_t new_pass_len;
void *sam_ctx = NULL;
const char *user_dn, *domain_dn = NULL;
int ret;
struct samr_Hash *ntPwdHash;
struct samr_DomInfo1 *dominfo;
struct samr_ChangeReject *reject;
- uint32 reason = 0;
+ uint32_t reason = 0;
ZERO_STRUCT(r->out);
struct samr_Hash *lmNewHash,
struct samr_Hash *ntNewHash,
BOOL user_change,
- uint32 *reject_reason)
+ uint32_t *reject_reason)
{
const char * const user_attrs[] = { "userAccountControl", "lmPwdHistory",
"ntPwdHistory", "unicodePwd",
struct samr_CryptPassword *pwbuf)
{
char new_pass[512];
- uint32 new_pass_len;
+ uint32_t new_pass_len;
DATA_BLOB session_key = dce_call->conn->session_key;
SamOEMhashBlob(pwbuf->data, 516, &session_key);
*/
/* mapping between ADS userAccountControl and SAMR acct_flags */
static const struct {
- uint32 uf;
+ uint32_t uf;
uint16 acb;
} acct_flags_map[] = {
{ UF_ACCOUNTDISABLE, ACB_DISABLED },
{ UF_LOCKOUT, ACB_AUTOLOCK }
};
-uint32 samdb_acb2uf(uint16 acb)
+uint32_t samdb_acb2uf(uint16 acb)
{
- uint32 i, ret = 0;
+ uint32_t i, ret = 0;
for (i=0;i<ARRAY_SIZE(acct_flags_map);i++) {
if (acct_flags_map[i].acb & acb) {
ret |= acct_flags_map[i].uf;
/*
translated the UserFlags (userAccountControl) to ACB_CTRL Flags
*/
-uint16 samdb_uf2acb(uint32 uf)
+uint16 samdb_uf2acb(uint32_t uf)
{
- uint32 i;
+ uint32_t i;
uint16 ret = 0;
for (i=0;i<ARRAY_SIZE(acct_flags_map);i++) {
if (acct_flags_map[i].uf & uf) {
/*
get the accountType from the UserFlags
*/
-uint32 samdb_uf2atype(uint32 uf)
+uint32_t samdb_uf2atype(uint32_t uf)
{
- uint32 atype = 0x00000000;
+ uint32_t atype = 0x00000000;
if (uf & UF_NORMAL_ACCOUNT) atype = ATYPE_NORMAL_ACCOUNT;
else if (uf & UF_TEMP_DUPLICATE_ACCOUNT) atype = ATYPE_NORMAL_ACCOUNT;
/*
get the accountType from the groupType
*/
-uint32 samdb_gtype2atype(uint32 gtype)
+uint32_t samdb_gtype2atype(uint32_t gtype)
{
- uint32 atype = 0x00000000;
+ uint32_t atype = 0x00000000;
switch(gtype) {
case GTYPE_SECURITY_BUILTIN_LOCAL_GROUP:
}
/* turn a sAMAccountType into a SID_NAME_USE */
-enum SID_NAME_USE samdb_atype_map(uint32 atype)
+enum SID_NAME_USE samdb_atype_map(uint32_t atype)
{
switch (atype & 0xF0000000) {
case ATYPE_GLOBAL_GROUP:
Claim an entry in the connections database.
****************************************************************************/
-BOOL claim_connection(struct tcon_context *conn, const char *name,int max_connections,BOOL Clear, uint32 msg_flags)
+BOOL claim_connection(struct tcon_context *conn, const char *name,int max_connections,BOOL Clear, uint32_t msg_flags)
{
struct connections_key key;
struct connections_data crec;
return True;
}
-BOOL register_message_flags(BOOL doreg, uint32 msg_flags)
+BOOL register_message_flags(BOOL doreg, uint32_t msg_flags)
{
struct connections_key key;
struct connections_data *pcrec;
struct smb_nttrans *trans)
{
union smb_ioctl nt;
- uint32 function;
+ uint32_t function;
uint16 fnum;
uint8 filter;
BOOL fsctl;
/* the 64 bit varient */
if (req->in.wct == 10) {
- uint32 offset_high = IVAL(req->in.vwv, VWV(8));
+ uint32_t offset_high = IVAL(req->in.vwv, VWV(8));
io.readbraw.in.offset |= (((SMB_OFF_T)offset_high) << 32);
}
/* the 64 bit varient */
if (req->in.wct == 12) {
- uint32 offset_high = IVAL(req->in.vwv, VWV(10));
+ uint32_t offset_high = IVAL(req->in.vwv, VWV(10));
io->readx.in.offset |= (((uint64_t)offset_high) << 32);
}
io->writex.in.data = req->in.hdr + SVAL(req->in.vwv, VWV(11));
if (req->in.wct == 14) {
- uint32 offset_high = IVAL(req->in.vwv, VWV(12));
+ uint32_t offset_high = IVAL(req->in.vwv, VWV(12));
uint16 count_high = SVAL(req->in.vwv, VWV(9));
io->writex.in.offset |= (((uint64_t)offset_high) << 32);
- io->writex.in.count |= ((uint32)count_high) << 16;
+ io->writex.in.count |= ((uint32_t)count_high) << 16;
}
/* make sure the data is in bounds */
/* construct the locks array */
for (i=0;i<total_locks;i++) {
- uint32 ofs_high=0, count_high=0;
+ uint32_t ofs_high=0, count_high=0;
lck->lockx.in.locks[i].pid = SVAL(p, 0);
*/
static void req_setup_chain_reply(struct request_context *req, unsigned wct, unsigned buflen)
{
- uint32 chain_base_size = req->out.size;
+ uint32_t chain_base_size = req->out.size;
/* we need room for the wct value, the words, the buffer length and the buffer */
req->out.size += 1 + VWV(wct) + 2 + buflen;
if (!lp_nt_status_support() || !(req->smb->negotiate.client_caps & CAP_STATUS32)) {
/* convert to DOS error codes */
uint8 eclass;
- uint32 ecode;
+ uint32_t ecode;
ntstatus_to_dos(status, &eclass, &ecode);
req_reply_dos_error(req, eclass, ecode);
return;
/* check that a lump of data in a request is within the bounds of the data section of
the packet */
-BOOL req_data_oob(struct request_context *req, const char *ptr, uint32 count)
+BOOL req_data_oob(struct request_context *req, const char *ptr, uint32_t count)
{
if (count == 0) {
return False;
union smb_search_data *file)
{
char *p = req->out.data + req->out.data_size;
- uint32 dos_date;
+ uint32_t dos_date;
char search_name[13];
DEBUG(9,("find_fill_info: input file data: attr=0x%x size=%u time=0x%x name=%13s\n",
file->search.attrib, file->search.size,
- (uint32)file->search.write_time, file->search.name));
+ (uint32_t)file->search.write_time, file->search.name));
p += req_append_bytes(req, file->search.search_id.data, 21);
p += req_append_bytes(req, (char*)&file->search.attrib, 1);
SSVAL(trans->out.params.data, 0, 0);
SIVAL(trans->out.data.data, 0, 0);
} else {
- uint32 list_size = ea_list_size(st->all_eas.out.num_eas,
+ uint32_t list_size = ea_list_size(st->all_eas.out.num_eas,
st->all_eas.out.eas);
trans2_setup_reply(req, trans, 2, list_size, 0);
SSVAL(trans->out.params.data, 0, 0);
union smb_setfileinfo *st,
const DATA_BLOB *blob)
{
- uint32 len;
+ uint32_t len;
switch (st->generic.level) {
case RAW_SFILEINFO_GENERIC:
output(screen," sizeof(long): %d\n",sizeof(long));
output(screen," sizeof(uint8): %d\n",sizeof(uint8));
output(screen," sizeof(uint16): %d\n",sizeof(uint16));
- output(screen," sizeof(uint32): %d\n",sizeof(uint32));
+ output(screen," sizeof(uint32_t): %d\n",sizeof(uint32_t));
output(screen," sizeof(short): %d\n",sizeof(short));
output(screen," sizeof(void*): %d\n",sizeof(void*));
}
if (rc == EBUSY) {
mutex_start_timer(&tp1);
printf("mutex lock: thread %d, lock %s not available\n",
- (uint32)pthread_self(), name);
+ (uint32_t)pthread_self(), name);
print_suspicious_usage("mutex_lock", name);
pthread_mutex_lock(mutex);
t = mutex_end_timer(tp1);
printf("mutex lock: thread %d, lock %s now available, waited %g seconds\n",
- (uint32)pthread_self(), name, t);
+ (uint32_t)pthread_self(), name, t);
return 0;
}
printf("mutex lock: thread %d, lock %s failed rc=%d\n",
- (uint32)pthread_self(), name, rc);
+ (uint32_t)pthread_self(), name, rc);
SMB_ASSERT(errno == 0); /* force error */
}
return 0;
if (rc == EBUSY) {
mutex_start_timer(&tp1);
printf("rwlock lock_read: thread %d, lock %s not available\n",
- (uint32)pthread_self(), name);
+ (uint32_t)pthread_self(), name);
print_suspicious_usage("rwlock_lock_read", name);
pthread_rwlock_rdlock(rwlock);
t = mutex_end_timer(tp1);
printf("rwlock lock_read: thread %d, lock %s now available, waited %g seconds\n",
- (uint32)pthread_self(), name, t);
+ (uint32_t)pthread_self(), name, t);
return 0;
}
printf("rwlock lock_read: thread %d, lock %s failed rc=%d\n",
- (uint32)pthread_self(), name, rc);
+ (uint32_t)pthread_self(), name, rc);
SMB_ASSERT(errno == 0); /* force error */
}
return 0;
if (rc == EBUSY) {
mutex_start_timer(&tp1);
printf("rwlock lock_write: thread %d, lock %s not available\n",
- (uint32)pthread_self(), name);
+ (uint32_t)pthread_self(), name);
print_suspicious_usage("rwlock_lock_write", name);
pthread_rwlock_wrlock(rwlock);
t = mutex_end_timer(tp1);
printf("rwlock lock_write: thread %d, lock %s now available, waited %g seconds\n",
- (uint32)pthread_self(), name, t);
+ (uint32_t)pthread_self(), name, t);
return 0;
}
printf("rwlock lock_write: thread %d, lock %s failed rc=%d\n",
- (uint32)pthread_self(), name, rc);
+ (uint32_t)pthread_self(), name, rc);
SMB_ASSERT(errno == 0); /* force error */
}
return 0;
#endif
}
-static uint32 thread_get_task_id(void)
+static uint32_t thread_get_task_id(void)
{
- return (uint32)pthread_self();
+ return (uint32_t)pthread_self();
}
static void thread_log_task_id(int fd)
{
char *s;
- asprintf(&s, "thread %u: ", (uint32)pthread_self());
+ asprintf(&s, "thread %u: ", (uint32_t)pthread_self());
write(fd, s, strlen(s));
free(s);
}
BOOL init_registry(void)
{ return True; }
-BOOL share_access_check(struct request_context *req, struct tcon_context *conn, int snum, uint32 desired_access)
+BOOL share_access_check(struct request_context *req, struct tcon_context *conn, int snum, uint32_t desired_access)
{ return True; }
BOOL init_names(void)
/* Output the build options to the debug log */
build_options(False);
- if (sizeof(uint16) < 2 || sizeof(uint32) < 4) {
+ if (sizeof(uint16) < 2 || sizeof(uint32_t) < 4) {
DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n"));
exit(1);
}
*/
static NTSTATUS unicode_open(struct cli_tree *tree,
TALLOC_CTX *mem_ctx,
- uint32 open_disposition,
- const uint32 *u_name,
+ uint32_t open_disposition,
+ const uint32_t *u_name,
size_t u_name_len)
{
union smb_open io;
*/
static BOOL test_composed(struct cli_state *cli, TALLOC_CTX *mem_ctx)
{
- const uint32 name1[] = {0x61, 0x308};
- const uint32 name2[] = {0xe4};
+ const uint32_t name1[] = {0x61, 0x308};
+ const uint32_t name2[] = {0xe4};
NTSTATUS status1, status2;
printf("Testing composite character (a umlaut)\n");
*/
static BOOL test_diacritical(struct cli_state *cli, TALLOC_CTX *mem_ctx)
{
- const uint32 name1[] = {0x308};
- const uint32 name2[] = {0x308, 0x308};
+ const uint32_t name1[] = {0x308};
+ const uint32_t name2[] = {0x308, 0x308};
NTSTATUS status1, status2;
printf("Testing naked diacritical (umlaut)\n");
*/
static BOOL test_surrogate(struct cli_state *cli, TALLOC_CTX *mem_ctx)
{
- const uint32 name1[] = {0xd800};
- const uint32 name2[] = {0xdc00};
- const uint32 name3[] = {0xd800, 0xdc00};
+ const uint32_t name1[] = {0xd800};
+ const uint32_t name2[] = {0xdc00};
+ const uint32_t name3[] = {0xd800, 0xdc00};
NTSTATUS status;
printf("Testing partial surrogate\n");
*/
static BOOL test_widea(struct cli_state *cli, TALLOC_CTX *mem_ctx)
{
- const uint32 name1[] = {'a'};
- const uint32 name2[] = {0xff41};
- const uint32 name3[] = {0xff21};
+ const uint32_t name1[] = {'a'};
+ const uint32_t name2[] = {0xff41};
+ const uint32_t name3[] = {0xff21};
NTSTATUS status;
printf("Testing wide-a\n");
/*
generate a bitmask
*/
-static uint32 gen_bits_mask(uint_t mask)
+static uint32_t gen_bits_mask(uint_t mask)
{
uint_t ret = random();
return ret & mask;
generate a bitmask with high probability of the first mask
and low of the second
*/
-static uint32 gen_bits_mask2(uint32 mask1, uint32 mask2)
+static uint32_t gen_bits_mask2(uint32_t mask1, uint32_t mask2)
{
if (gen_chance(10)) return gen_bits_mask(mask2);
return gen_bits_mask(mask1);
/*
generate a ntcreatex flags field
*/
-static uint32 gen_ntcreatex_flags(void)
+static uint32_t gen_ntcreatex_flags(void)
{
if (gen_chance(70)) return NTCREATEX_FLAGS_EXTENDED;
return gen_bits_mask2(0x1F, 0xFFFFFFFF);
/*
generate a NT access mask
*/
-static uint32 gen_access_mask(void)
+static uint32_t gen_access_mask(void)
{
if (gen_chance(50)) return SEC_RIGHT_MAXIMUM_ALLOWED;
if (gen_chance(20)) return GENERIC_RIGHTS_FILE_ALL_ACCESS;
/*
generate a ntcreatex create options bitfield
*/
-static uint32 gen_create_options(void)
+static uint32_t gen_create_options(void)
{
if (gen_chance(20)) return gen_bits_mask(0xFFFFFFFF);
if (gen_chance(50)) return 0;
/*
generate a ntcreatex open disposition
*/
-static uint32 gen_open_disp(void)
+static uint32_t gen_open_disp(void)
{
if (gen_chance(10)) return gen_bits_mask(0xFFFFFFFF);
return gen_int_range(0, 5);
/*
generate a file attrib combination
*/
-static uint32 gen_attrib(void)
+static uint32_t gen_attrib(void)
{
if (gen_chance(20)) return gen_bits_mask(0xFFFFFFFF);
return gen_bits_mask(FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY);
/*
generate a milliseconds protocol timeout
*/
-static uint32 gen_timeout(void)
+static uint32_t gen_timeout(void)
{
if (gen_chance(98)) return 0;
return random() % 50;
NTSTATUS status)
{
union smb_open io;
- uint32 desired_access;
+ uint32_t desired_access;
NTSTATUS ret;
TALLOC_CTX *mem_ctx;
unsigned flags = 0;
BOOL ret = True;
int i;
struct {
- uint32 open_disp;
+ uint32_t open_disp;
BOOL with_file;
NTSTATUS correct_status;
} open_funcs[] = {
enum fileinfo_level level;
unsigned only_paths:1;
unsigned only_handles:1;
- uint32 capability_mask;
+ uint32_t capability_mask;
NTSTATUS fnum_status, fname_status;
union smb_fileinfo fnum_finfo, fname_finfo;
} levels[] = {
const char *fname = "\\torture_qfileinfo.txt";
NTTIME correct_time;
uint64_t correct_size;
- uint32 correct_attrib;
+ uint32_t correct_attrib;
const char *correct_name;
BOOL skip_streams = False;
/* check for completely broken levels */
for (count=i=0; levels[i].name; i++) {
- uint32 cap = cli->transport->negotiate.capabilities;
+ uint32_t cap = cli->transport->negotiate.capabilities;
/* see if this server claims to support this level */
if ((cap & levels[i].capability_mask) != levels[i].capability_mask) {
continue;
static struct {
const char *name;
enum fsinfo_level level;
- uint32 capability_mask;
+ uint32_t capability_mask;
NTSTATUS status;
union smb_fsinfo fsinfo;
} levels[] = {
/* check for completely broken levels */
for (count=i=0; levels[i].name; i++) {
- uint32 cap = cli->transport->negotiate.capabilities;
+ uint32_t cap = cli->transport->negotiate.capabilities;
/* see if this server claims to support this level */
if ((cap & levels[i].capability_mask) != levels[i].capability_mask) {
continue;
static struct {
const char *name;
enum search_level level;
- uint32 capability_mask;
+ uint32_t capability_mask;
NTSTATUS status;
union smb_search_data data;
} levels[] = {
/* call all the levels */
for (i=0;i<ARRAY_SIZE(levels);i++) {
- uint32 cap = cli->transport->negotiate.capabilities;
+ uint32_t cap = cli->transport->negotiate.capabilities;
printf("testing %s\n", levels[i].name);
#include "includes.h"
-static BOOL test_JobGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32 job_id)
+static BOOL test_JobGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32_t job_id)
{
NTSTATUS status;
struct atsvc_JobGetInfo r;
return True;
}
-static BOOL test_JobDel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32 min_job_id,
- uint32 max_job_id)
+static BOOL test_JobDel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32_t min_job_id,
+ uint32_t max_job_id)
{
NTSTATUS status;
struct atsvc_JobDel r;
NTSTATUS status;
struct atsvc_JobEnum r;
struct atsvc_enum_ctr ctr;
- uint32 resume_handle = 0, i;
+ uint32_t resume_handle = 0, i;
BOOL ret = True;
printf("\ntesting JobEnum\n");
{
NTSTATUS status;
struct dfs_Exist r;
- uint32 exist = 0;
+ uint32_t exist = 0;
r.out.exist_flag = ∃
{
NTSTATUS status;
struct dfs_Enum r;
- uint32 total=0;
+ uint32_t total=0;
struct dfs_EnumStruct e;
struct dfs_Info1 s;
struct dfs_EnumArray1 e1;
BOOL ret = True;
r.in.level = level;
- r.in.bufsize = (uint32)-1;
+ r.in.bufsize = (uint32_t)-1;
r.in.total = &total;
r.in.unknown = &total;
r.in.info = &e;
printf("\nTesting AddOne\n");
for (i=0;i<10;i++) {
- uint32 n = i;
+ uint32_t n = i;
struct echo_AddOne r;
r.in.v = &n;
r.out.v = &n;
return True;
}
-static BOOL test_ReadEventLog(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32 offset)
+static BOOL test_ReadEventLog(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t offset)
{
NTSTATUS status;
struct eventlog_ReadEventLog r;
struct lsa_LookupNames r;
struct lsa_TransSidArray sids;
struct lsa_Name *names;
- uint32 count = 0;
+ uint32_t count = 0;
NTSTATUS status;
int i;
{
struct lsa_LookupSids r;
struct lsa_TransNameArray names;
- uint32 count = sids->num_sids;
+ uint32_t count = sids->num_sids;
NTSTATUS status;
printf("\nTesting LookupSids\n");
NTSTATUS status;
struct lsa_EnumAccounts r;
struct lsa_SidArray sids1, sids2;
- uint32 resume_handle = 0;
+ uint32_t resume_handle = 0;
int i;
printf("\ntesting EnumAccounts\n");
NTSTATUS status;
struct lsa_EnumPrivs r;
struct lsa_PrivArray privs1;
- uint32 resume_handle = 0;
+ uint32_t resume_handle = 0;
printf("\ntesting EnumPrivs\n");
{
struct lsa_EnumTrustDom r;
NTSTATUS status;
- uint32 resume_handle = 0;
+ uint32_t resume_handle = 0;
struct lsa_DomainList domains;
printf("\nTesting EnumTrustDom\n");
printf("\nTesting pipe '%s'\n", dcerpc_pipes[i]->name);
if (b.transport == NCACN_IP_TCP) {
- uint32 port;
+ uint32_t port;
status = dcerpc_epm_map_tcp_port(b.host,
dcerpc_pipes[i]->uuid,
dcerpc_pipes[i]->if_version,
union samr_UserInfo u;
struct policy_handle handle;
struct policy_handle domain_handle;
- uint32 access_granted;
- uint32 rid;
+ uint32_t access_granted;
+ uint32_t rid;
BOOL ret = True;
DATA_BLOB session_key;
struct samr_Name name;
}
static BOOL test_SetupCredentials2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- uint32 negotiate_flags,
+ uint32_t negotiate_flags,
struct creds_CredentialState *creds)
{
NTSTATUS status;
NTSTATUS status;
struct netr_DatabaseSync r;
struct creds_CredentialState creds;
- const uint32 database_ids[] = {0, 1, 2};
+ const uint32_t database_ids[] = {0, 1, 2};
int i;
BOOL ret = True;
r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
r.in.computername = TEST_MACHINE_NAME;
- r.in.preferredmaximumlength = (uint32)-1;
+ r.in.preferredmaximumlength = (uint32_t)-1;
ZERO_STRUCT(r.in.return_authenticator);
for (i=0;i<ARRAY_SIZE(database_ids);i++) {
NTSTATUS status;
struct netr_DatabaseDeltas r;
struct creds_CredentialState creds;
- const uint32 database_ids[] = {0, 1, 2};
+ const uint32_t database_ids[] = {0, 1, 2};
int i;
BOOL ret = True;
r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
r.in.computername = TEST_MACHINE_NAME;
- r.in.preferredmaximumlength = (uint32)-1;
+ r.in.preferredmaximumlength = (uint32_t)-1;
ZERO_STRUCT(r.in.return_authenticator);
for (i=0;i<ARRAY_SIZE(database_ids);i++) {
NTSTATUS status;
struct netr_DatabaseSync2 r;
struct creds_CredentialState creds;
- const uint32 database_ids[] = {0, 1, 2};
+ const uint32_t database_ids[] = {0, 1, 2};
int i;
BOOL ret = True;
r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
r.in.computername = TEST_MACHINE_NAME;
- r.in.preferredmaximumlength = (uint32)-1;
+ r.in.preferredmaximumlength = (uint32_t)-1;
ZERO_STRUCT(r.in.return_authenticator);
for (i=0;i<ARRAY_SIZE(database_ids);i++) {
static NTSTATUS test_LookupName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *domain_handle, const char *name,
- uint32 *rid)
+ uint32_t *rid)
{
NTSTATUS status;
struct samr_LookupNames n;
{
NTSTATUS status;
struct samr_OpenUser r;
- uint32 rid;
+ uint32_t rid;
status = test_LookupName(p, mem_ctx, domain_handle, name, &rid);
if (!NT_STATUS_IS_OK(status)) {
NTSTATUS status;
struct samr_DeleteUser d;
struct policy_handle acct_handle;
- uint32 rid;
+ uint32_t rid;
status = test_LookupName(p, mem_ctx, handle, name, &rid);
if (!NT_STATUS_IS_OK(status)) {
struct samr_OpenGroup r;
struct samr_DeleteDomainGroup d;
struct policy_handle group_handle;
- uint32 rid;
+ uint32_t rid;
status = test_LookupName(p, mem_ctx, handle, name, &rid);
if (!NT_STATUS_IS_OK(status)) {
struct samr_OpenAlias r;
struct samr_DeleteDomAlias d;
struct policy_handle alias_handle;
- uint32 rid;
+ uint32_t rid;
printf("testing DeleteAlias_byname\n");
NTSTATUS status;
struct samr_CreateDomAlias r;
struct samr_Name name;
- uint32 rid;
+ uint32_t rid;
BOOL ret = True;
init_samr_Name(&name, TEST_ALIASNAME);
NTSTATUS status;
struct samr_CreateUser r;
struct samr_QueryUserInfo q;
- uint32 rid;
+ uint32_t rid;
char *password = NULL;
/* This call creates a 'normal' account - check that it really does */
- const uint32 acct_flags = ACB_NORMAL;
+ const uint32_t acct_flags = ACB_NORMAL;
struct samr_Name name;
BOOL ret = True;
struct samr_QueryUserInfo q;
struct samr_DeleteUser d;
struct policy_handle acct_handle;
- uint32 rid;
+ uint32_t rid;
struct samr_Name name;
BOOL ret = True;
int i;
struct {
- uint32 acct_flags;
+ uint32_t acct_flags;
const char *account_name;
NTSTATUS nt_status;
} account_types[] = {
};
for (i = 0; account_types[i].account_name; i++) {
- uint32 acct_flags = account_types[i].acct_flags;
- uint32 access_granted;
+ uint32_t acct_flags = account_types[i].acct_flags;
+ uint32_t access_granted;
init_samr_Name(&name, account_types[i].account_name);
}
static BOOL test_OpenUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle, uint32 rid)
+ struct policy_handle *handle, uint32_t rid)
{
NTSTATUS status;
struct samr_OpenUser r;
}
static BOOL test_OpenGroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle, uint32 rid)
+ struct policy_handle *handle, uint32_t rid)
{
NTSTATUS status;
struct samr_OpenGroup r;
}
static BOOL test_OpenAlias(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle, uint32 rid)
+ struct policy_handle *handle, uint32_t rid)
{
NTSTATUS status;
struct samr_OpenAlias r;
{
NTSTATUS status;
struct samr_EnumDomainUsers r;
- uint32 resume_handle=0;
+ uint32_t resume_handle=0;
int i;
BOOL ret = True;
struct samr_LookupNames n;
r.in.handle = handle;
r.in.resume_handle = &resume_handle;
r.in.acct_flags = 0;
- r.in.max_size = (uint32)-1;
+ r.in.max_size = (uint32_t)-1;
r.out.resume_handle = &resume_handle;
status = dcerpc_samr_EnumDomainUsers(p, mem_ctx, &r);
printf("Testing LookupRids\n");
lr.in.handle = handle;
lr.in.num_rids = r.out.sam->count;
- lr.in.rids = talloc(mem_ctx, r.out.sam->count * sizeof(uint32));
+ lr.in.rids = talloc(mem_ctx, r.out.sam->count * sizeof(uint32_t));
for (i=0;i<r.out.sam->count;i++) {
lr.in.rids[i] = r.out.sam->entries[i].idx;
}
{
NTSTATUS status;
struct samr_EnumDomainGroups r;
- uint32 resume_handle=0;
+ uint32_t resume_handle=0;
int i;
BOOL ret = True;
r.in.handle = handle;
r.in.resume_handle = &resume_handle;
- r.in.max_size = (uint32)-1;
+ r.in.max_size = (uint32_t)-1;
r.out.resume_handle = &resume_handle;
status = dcerpc_samr_EnumDomainGroups(p, mem_ctx, &r);
{
NTSTATUS status;
struct samr_EnumDomainAliases r;
- uint32 resume_handle=0;
+ uint32_t resume_handle=0;
int i;
BOOL ret = True;
r.in.handle = handle;
r.in.resume_handle = &resume_handle;
- r.in.max_size = (uint32)-1;
+ r.in.max_size = (uint32_t)-1;
r.out.resume_handle = &resume_handle;
status = dcerpc_samr_EnumDomainAliases(p, mem_ctx, &r);
r.in.level = levels[i];
r.in.start_idx = 0;
r.in.max_entries = 1000;
- r.in.buf_size = (uint32)-1;
+ r.in.buf_size = (uint32_t)-1;
status = dcerpc_samr_QueryDisplayInfo(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
r.in.level = levels[i];
r.in.start_idx = 0;
r.in.max_entries = 1000;
- r.in.buf_size = (uint32)-1;
+ r.in.buf_size = (uint32_t)-1;
status = dcerpc_samr_QueryDisplayInfo2(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
r.in.level = levels[i];
r.in.start_idx = 0;
r.in.max_entries = 1000;
- r.in.buf_size = (uint32)-1;
+ r.in.buf_size = (uint32_t)-1;
status = dcerpc_samr_QueryDisplayInfo3(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
struct samr_EnumDomainGroups q1;
struct samr_QueryDisplayInfo q2;
NTSTATUS status;
- uint32 resume_handle=0;
+ uint32_t resume_handle=0;
int i;
BOOL ret = True;
q2.in.level = 5;
q2.in.start_idx = 0;
q2.in.max_entries = 5;
- q2.in.buf_size = (uint32)-1;
+ q2.in.buf_size = (uint32_t)-1;
status = STATUS_MORE_ENTRIES;
while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
struct samr_QueryGroupMember q;
struct samr_SetMemberAttributesOfGroup s;
BOOL ret = True;
- uint32 rid;
+ uint32_t rid;
status = test_LookupName(p, mem_ctx, domain_handle, TEST_USERNAME, &rid);
if (!NT_STATUS_IS_OK(status)) {
{
NTSTATUS status;
struct samr_CreateDomainGroup r;
- uint32 rid;
+ uint32_t rid;
struct samr_Name name;
BOOL ret = True;
{
NTSTATUS status;
struct samr_EnumDomains r;
- uint32 resume_handle = 0;
+ uint32_t resume_handle = 0;
int i;
BOOL ret = True;
r.in.handle = handle;
r.in.resume_handle = &resume_handle;
- r.in.buf_size = (uint32)-1;
+ r.in.buf_size = (uint32_t)-1;
r.out.resume_handle = &resume_handle;
status = dcerpc_samr_EnumDomains(p, mem_ctx, &r);
printf("\nTesting pipe '%s'\n", dcerpc_pipes[i]->name);
if (b.transport == NCACN_IP_TCP) {
- uint32 port;
+ uint32_t port;
status = dcerpc_epm_map_tcp_port(b.host,
dcerpc_pipes[i]->uuid,
dcerpc_pipes[i]->if_version,
BOOL ret = True;
for (i=0;i<ARRAY_SIZE(levels);i++) {
- uint32 buf_size = 0;
+ uint32_t buf_size = 0;
r.in.handle = handle;
r.in.level = levels[i];
r.in.buffer = NULL;
{
NTSTATUS status;
struct spoolss_GetForm r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.formname = formname;
{
NTSTATUS status;
struct spoolss_EnumForms r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.level = 1;
}
static BOOL test_GetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle, uint32 job_id)
+ struct policy_handle *handle, uint32_t job_id)
{
NTSTATUS status;
struct spoolss_GetJob r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.job_id = job_id;
}
static BOOL test_SetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle, uint32 job_id, uint32 command)
+ struct policy_handle *handle, uint32_t job_id, uint32_t command)
{
NTSTATUS status;
struct spoolss_SetJob r;
{
NTSTATUS status;
struct spoolss_EnumJobs r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.firstjob = 0;
{
NTSTATUS status;
struct spoolss_GetPrinterData r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.value_name = value_name;
{
NTSTATUS status;
struct spoolss_GetPrinterDataEx r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.key_name = key_name;
r.in.enum_index = 0;
do {
- uint32 data_size;
+ uint32_t data_size;
r.in.value_offered = 0;
data_size = 0;
BOOL ret = True;
for (i=0;i<ARRAY_SIZE(levels);i++) {
- uint32 buf_size = 0;
+ uint32_t buf_size = 0;
union spoolss_PrinterInfo *info;
int j;
{
NTSTATUS status;
struct spoolss_GetPrinterDriver2 r;
- uint32 buf_size;
+ uint32_t buf_size;
r.in.handle = handle;
r.in.architecture = "W32X86";
BOOL ret = True;
for (i=0;i<ARRAY_SIZE(levels);i++) {
- uint32 buf_size;
+ uint32_t buf_size;
char *server;
union spoolss_DriverInfo *info;
- uint32 j;
+ uint32_t j;
asprintf(&server, "\\\\%s", dcerpc_server_name(p));
r.in.server = server;
NTSTATUS status;
struct srvsvc_NetConnEnum r;
struct srvsvc_NetConnCtr0 c0;
- uint32 levels[] = {0, 1};
+ uint32_t levels[] = {0, 1};
int i;
BOOL ret = True;
r.in.ctr.ctr0 = &c0;
r.in.ctr.ctr0->count = 0;
r.in.ctr.ctr0->array = NULL;
- r.in.max_buffer = (uint32)-1;
+ r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = NULL;
for (i=0;i<ARRAY_SIZE(levels);i++) {
NTSTATUS status;
struct srvsvc_NetFileEnum r;
struct srvsvc_NetFileCtr3 c3;
- uint32 levels[] = {2, 3};
+ uint32_t levels[] = {2, 3};
int i;
BOOL ret = True;
r.in.ctr.ctr3 = &c3;
r.in.ctr.ctr3->count = 0;
r.in.ctr.ctr3->array = NULL;
- r.in.max_buffer = (uint32)4096;
+ r.in.max_buffer = (uint32_t)4096;
r.in.resume_handle = NULL;
for (i=0;i<ARRAY_SIZE(levels);i++) {
NTSTATUS status;
struct srvsvc_NetSessEnum r;
struct srvsvc_NetSessCtr0 c0;
- uint32 levels[] = {0, 1, 2, 10, 502};
+ uint32_t levels[] = {0, 1, 2, 10, 502};
int i;
BOOL ret = True;
r.in.ctr.ctr0 = &c0;
r.in.ctr.ctr0->count = 0;
r.in.ctr.ctr0->array = NULL;
- r.in.max_buffer = (uint32)-1;
+ r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = NULL;
for (i=0;i<ARRAY_SIZE(levels);i++) {
NTSTATUS status;
struct srvsvc_NetShareEnumAll r;
struct srvsvc_NetShareCtr0 c0;
- uint32 levels[] = {0, 1, 2, 501, 502, 1004};
+ uint32_t levels[] = {0, 1, 2, 501, 502, 1004};
int i;
BOOL ret = True;
- uint32 resume_handle;
+ uint32_t resume_handle;
ZERO_STRUCT(c0);
r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p));
r.in.ctr.ctr0 = &c0;
- r.in.max_buffer = (uint32)-1;
+ r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = &resume_handle;
r.out.resume_handle = &resume_handle;
{
NTSTATUS status;
struct srvsvc_NetDiskEnum r;
- uint32 levels[] = {0};
+ uint32_t levels[] = {0};
int i;
BOOL ret = True;
- uint32 resume_handle=0;
+ uint32_t resume_handle=0;
r.in.server_unc = NULL;
r.in.unknown = 0;
NTSTATUS status;
struct srvsvc_NetTransportEnum r;
struct srvsvc_NetTransportCtr0 c0;
- uint32 levels[] = {0, 1};
+ uint32_t levels[] = {0, 1};
int i;
BOOL ret = True;
r.in.ctr.ctr0 = &c0;
r.in.ctr.ctr0->count = 0;
r.in.ctr.ctr0->array = NULL;
- r.in.max_buffer = (uint32)-1;
+ r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = NULL;
for (i=0;i<ARRAY_SIZE(levels);i++) {
NTSTATUS status;
struct srvsvc_NetShareEnum r;
struct srvsvc_NetShareCtr0 c0;
- uint32 levels[] = {0, 1, 2, 502};
+ uint32_t levels[] = {0, 1, 2, 502};
int i;
BOOL ret = True;
r.in.ctr.ctr0 = &c0;
r.in.ctr.ctr0->count = 0;
r.in.ctr.ctr0->array = NULL;
- r.in.max_buffer = (uint32)-1;
+ r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = NULL;
for (i=0;i<ARRAY_SIZE(levels);i++) {
struct winreg_CreateKey r;
struct policy_handle newhandle;
NTSTATUS status;
- uint32 sec_info = 0;
+ uint32_t sec_info = 0;
printf("\ntesting CreateKey\n");
struct winreg_EnumValue r;
struct winreg_Uint8buf vb;
struct winreg_EnumValueName vn;
- uint32 type = 0, requested_len = max_valbufsize, returned_len = 0;
+ uint32_t type = 0, requested_len = max_valbufsize, returned_len = 0;
NTSTATUS status;
r.in.handle = handle;
}
static BOOL test_InitiateSystemShutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- const char *msg, uint32 timeout)
+ const char *msg, uint32_t timeout)
{
struct winreg_InitiateSystemShutdown r;
NTSTATUS status;
NTSTATUS status;
struct wkssvc_NetWkstaTransportEnum r;
BOOL ret = True;
- uint32 resume_handle = 0;
+ uint32_t resume_handle = 0;
struct wkssvc_NetWkstaTransportCtr0 ctr0;
ZERO_STRUCT(ctr0);
r.in.server_name = dcerpc_server_name(p);
r.in.level = 0;
r.in.ctr.ctr0 = &ctr0;
- r.in.max_buffer = (uint32)-1;
+ r.in.max_buffer = (uint32_t)-1;
r.in.resume_handle = &resume_handle;
r.out.resume_handle = &resume_handle;
NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p,
const char *pipe_name,
const char *pipe_uuid,
- uint32 pipe_version)
+ uint32_t pipe_version)
{
NTSTATUS status;
char *binding = lp_parm_string(-1, "torture", "binding");
/* check if the server produced the expected error code */
static BOOL check_error(int line, struct cli_state *c,
- uint8 eclass, uint32 ecode, NTSTATUS nterr)
+ uint8 eclass, uint32_t ecode, NTSTATUS nterr)
{
if (cli_is_dos_error(c->tree)) {
uint8 class;
- uint32 num;
+ uint32_t num;
/* Check DOS error */
}
-static BOOL wait_lock(struct cli_state *c, int fnum, uint32 offset, uint32 len)
+static BOOL wait_lock(struct cli_state *c, int fnum, uint32_t offset, uint32_t len)
{
while (NT_STATUS_IS_ERR(cli_lock(c->tree, fnum, offset, len, -1, WRITE_LOCK))) {
if (!check_error(__LINE__, c, ERRDOS, ERRlock, NT_STATUS_LOCK_NOT_GRANTED)) return False;
BOOL correct = True;
srandom(1);
- for (i = 0; i < sizeof(buf); i += sizeof(uint32))
+ for (i = 0; i < sizeof(buf); i += sizeof(uint32_t))
{
SIVAL(buf, i, sys_random());
}
struct cli_state *cli1, *cli2;
const char *fname = "\\lockt3.lck";
int fnum1, fnum2, i;
- uint32 offset;
+ uint32_t offset;
BOOL correct = True;
-#define NEXT_OFFSET offset += (~(uint32)0) / torture_numops
+#define NEXT_OFFSET offset += (~(uint32_t)0) / torture_numops
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
return False;
}
-static uint32 open_attrs_table[] = {
+static uint32_t open_attrs_table[] = {
FILE_ATTRIBUTE_NORMAL,
FILE_ATTRIBUTE_ARCHIVE,
FILE_ATTRIBUTE_READONLY,
struct trunc_open_results {
unsigned int num;
- uint32 init_attr;
- uint32 trunc_attr;
- uint32 result_attr;
+ uint32_t init_attr;
+ uint32_t trunc_attr;
+ uint32_t result_attr;
};
static struct trunc_open_results attr_results[] = {
return False;
}
- for (k = 0, i = 0; i < sizeof(open_attrs_table)/sizeof(uint32); i++) {
+ for (k = 0, i = 0; i < sizeof(open_attrs_table)/sizeof(uint32_t); i++) {
cli_setatr(cli1->tree, fname, 0, 0);
cli_unlink(cli1->tree, fname);
fnum1 = cli_nt_create_full(cli1->tree, fname, 0, SA_RIGHT_FILE_WRITE_DATA, open_attrs_table[i],
return 0;
}
-static uint32 get_maxrid(void)
+static uint32_t get_maxrid(void)
{
SAM_ACCOUNT *pwd = NULL;
- uint32 max_rid = 0;
+ uint32_t max_rid = 0;
GROUP_MAP *map = NULL;
int num_entries = 0;
int i;
for (; (NT_STATUS_IS_OK(pdb_init_sam(&pwd)))
&& pdb_getsampwent(pwd) == True; pwd=NULL) {
- uint32 rid;
+ uint32_t rid;
if (!sid_peek_rid(pdb_get_user_sid(pwd), &rid)) {
DEBUG(0, ("can't get RID for user '%s'\n",
return max_rid;
for (i = 0; i < num_entries; i++) {
- uint32 rid;
+ uint32_t rid;
if (!sid_peek_check_rid(get_global_sam_sid(), &map[i].sid,
&rid)) {
static int net_maxrid(int argc, const char **argv)
{
- uint32 rid;
+ uint32_t rid;
if (argc != 0) {
DEBUG(0, ("usage: net initrid\n"));
#ifdef HAVE_ADS
struct netlogon_string {
- uint32 comp_len;
+ uint32_t comp_len;
char **component;
uint8 extra_flag;
};
struct cldap_netlogon_reply {
- uint32 type;
- uint32 flags;
+ uint32_t type;
+ uint32_t flags;
GUID guid;
struct netlogon_string forest;
struct netlogon_string unk0;
- uint32 version;
+ uint32_t version;
uint16 lmnt_token;
uint16 lm20_token;
};
ASN1_DATA data;
DATA_BLOB blob;
DATA_BLOB os1, os2, os3;
- uint32 i1;
+ uint32_t i1;
char *p;
blob = data_blob(NULL, 8192);
list info on an open file
***************************************************************************/
static void file_fn(const char * pPath, const char * pUser, uint16 perms,
- uint16 locks, uint32 id)
+ uint16 locks, uint32_t id)
{
d_printf("%-7.1d %-20.20s 0x%-4.2x %-6.1d %s\n",
id, pUser, perms, locks, pPath);
}
static void one_file_fn(const char *pPath, const char *pUser, uint16 perms,
- uint16 locks, uint32 id)
+ uint16 locks, uint32_t id)
{
d_printf("File ID %d\n"\
"User name %s\n"\
return net_help_share(argc, argv);
}
-static void long_share_fn(const char *share_name, uint32 type,
+static void long_share_fn(const char *share_name, uint32_t type,
const char *comment, void *state)
{
d_printf("%-12.12s %-8.8s %-50.50s\n",
share_name, share_type[type], comment);
}
-static void share_fn(const char *share_name, uint32 type,
+static void share_fn(const char *share_name, uint32_t type,
const char *comment, void *state)
{
d_printf("%-12.12s\n", share_name);
}
static void list_sessions_func(char *wsname, char *username, uint16 conns,
- uint16 opens, uint16 users, uint32 sess_time,
- uint32 idle_time, uint32 user_flags, char *clitype)
+ uint16 opens, uint16 users, uint32_t sess_time,
+ uint32_t idle_time, uint32_t user_flags, char *clitype)
{
int hrs = idle_time / 3600;
int min = (idle_time / 60) % 60;
static void display_session_func(const char *wsname, const char *username,
uint16 conns, uint16 opens, uint16 users,
- uint32 sess_time, uint32 idle_time,
- uint32 user_flags, const char *clitype)
+ uint32_t sess_time, uint32_t idle_time,
+ uint32_t user_flags, const char *clitype)
{
int ihrs = idle_time / 3600;
int imin = (idle_time / 60) % 60;
}
static void display_conns_func(uint16 conn_id, uint16 conn_type, uint16 opens,
- uint16 users, uint32 conn_time,