From f9d8f8843dc0ab8c9d59abde7222e0f118b86b5d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 25 May 2004 16:24:13 +0000 Subject: [PATCH] r884: convert samba4 to use [u]int32_t instead of [u]int32 metze (This used to be commit 0e5517d937a2eb7cf707991d1c7498c1ab456095) --- source4/auth/auth_domain.c | 2 +- source4/build/m4/rewrite.m4 | 2 + source4/client/client.c | 4 +- source4/include/MacExtensions.h | 8 +- source4/include/byteorder.h | 20 +- source4/include/cli_context.h | 6 +- source4/include/context.h | 2 +- source4/include/debug.h | 2 +- source4/include/includes.h | 33 +- source4/include/md5.h | 4 +- source4/include/nameserv.h | 2 +- source4/include/nt_status.h | 8 +- source4/include/smb.h | 8 +- source4/include/smb_interfaces.h | 286 +++++++++--------- source4/include/smb_macros.h | 2 +- source4/lib/bitmap.c | 4 +- source4/lib/crypto/crc32.c | 4 +- source4/lib/crypto/md4.c | 28 +- source4/lib/crypto/md5.c | 28 +- source4/lib/debug.c | 2 +- source4/lib/genrand.c | 4 +- source4/lib/interface.c | 2 +- source4/lib/messages.c | 2 +- source4/lib/registry/common/reg_interface.c | 2 +- source4/lib/registry/common/reg_objects.c | 2 +- source4/lib/registry/common/reg_util.c | 2 +- source4/lib/registry/common/registry.h | 2 +- .../reg_backend_dir/reg_backend_dir.c | 2 +- .../reg_backend_nt4/reg_backend_nt4.c | 2 +- .../reg_backend_rpc/reg_backend_rpc.c | 4 +- source4/lib/system.c | 4 +- source4/lib/tdb/common/tdbutil.c | 70 ++--- source4/lib/time.c | 16 +- source4/lib/util.c | 12 +- source4/lib/util_sid.c | 8 +- source4/lib/util_sock.c | 2 +- source4/libads/ads_ldap.c | 8 +- source4/libads/ads_status.c | 4 +- source4/libads/disp_sec.c | 4 +- source4/libads/ldap.c | 16 +- source4/libads/ldap_printer.c | 8 +- source4/libads/sasl.c | 8 +- source4/libads/util.c | 2 +- source4/libcli/auth/credentials.c | 2 +- source4/libcli/auth/credentials.h | 2 +- source4/libcli/auth/ntlmssp.c | 16 +- source4/libcli/auth/ntlmssp.h | 6 +- source4/libcli/auth/ntlmssp_parse.c | 6 +- source4/libcli/auth/ntlmssp_sign.c | 4 +- source4/libcli/auth/schannel.h | 2 +- source4/libcli/clifile.c | 20 +- source4/libcli/raw/clikrb5.c | 4 +- source4/libcli/raw/raweas.c | 4 +- source4/libcli/raw/rawnotify.c | 4 +- source4/libcli/raw/rawrequest.c | 4 +- source4/libcli/raw/rawtrans.c | 10 +- source4/libcli/raw/smb_signing.c | 2 +- source4/libcli/util/clierror.c | 2 +- source4/libcli/util/dom_sid.c | 2 +- source4/libcli/util/errormap.c | 8 +- source4/libcli/util/smbencrypt.c | 2 +- source4/librpc/idl/mgmt.idl | 2 +- source4/librpc/ndr/libndr.h | 34 +-- source4/librpc/ndr/ndr.c | 40 +-- source4/librpc/ndr/ndr_basic.c | 70 ++--- source4/librpc/ndr/ndr_sec.c | 10 +- source4/librpc/ndr/ndr_sec.h | 4 +- source4/librpc/ndr/ndr_spoolss_buf.c | 8 +- source4/librpc/rpc/dcerpc.c | 6 +- source4/librpc/rpc/dcerpc.h | 16 +- source4/librpc/rpc/dcerpc_schannel.c | 2 +- source4/librpc/rpc/dcerpc_smb.c | 6 +- source4/librpc/rpc/dcerpc_tcp.c | 6 +- source4/librpc/rpc/dcerpc_util.c | 20 +- source4/ntvfs/ipc/vfs_ipc.c | 2 +- source4/ntvfs/reference/ref_util.c | 2 +- source4/param/loadparm.c | 10 +- source4/rpc_server/common/server_info.c | 6 +- source4/rpc_server/common/share_info.c | 16 +- source4/rpc_server/dcerpc_server.c | 20 +- source4/rpc_server/dcerpc_server.h | 8 +- source4/rpc_server/dcerpc_tcp.c | 2 +- source4/rpc_server/epmapper/rpc_epmapper.c | 12 +- source4/rpc_server/netlogon/dcerpc_netlogon.c | 6 +- source4/rpc_server/remote/dcesrv_remote.c | 2 +- source4/rpc_server/samr/dcesrv_samr.c | 12 +- source4/rpc_server/samr/dcesrv_samr.h | 6 +- source4/rpc_server/samr/samdb.c | 10 +- source4/rpc_server/samr/samr_password.c | 10 +- source4/rpc_server/samr/samr_utils.c | 20 +- source4/smb_server/connection.c | 4 +- source4/smb_server/nttrans.c | 2 +- source4/smb_server/reply.c | 10 +- source4/smb_server/request.c | 6 +- source4/smb_server/search.c | 4 +- source4/smb_server/trans2.c | 4 +- source4/smbd/build_options.c | 2 +- source4/smbd/process_thread.c | 24 +- source4/smbd/rewrite.c | 2 +- source4/smbd/server.c | 2 +- source4/torture/basic/charset.c | 24 +- source4/torture/gentest.c | 16 +- source4/torture/nbench/nbio.c | 2 +- source4/torture/raw/open.c | 2 +- source4/torture/raw/qfileinfo.c | 6 +- source4/torture/raw/qfsinfo.c | 4 +- source4/torture/raw/search.c | 4 +- source4/torture/rpc/atsvc.c | 8 +- source4/torture/rpc/dfs.c | 6 +- source4/torture/rpc/echo.c | 2 +- source4/torture/rpc/eventlog.c | 2 +- source4/torture/rpc/lsa.c | 10 +- source4/torture/rpc/mgmt.c | 2 +- source4/torture/rpc/netlogon.c | 18 +- source4/torture/rpc/samr.c | 62 ++-- source4/torture/rpc/scanner.c | 2 +- source4/torture/rpc/spoolss.c | 28 +- source4/torture/rpc/srvsvc.c | 30 +- source4/torture/rpc/winreg.c | 6 +- source4/torture/rpc/wkssvc.c | 4 +- source4/torture/torture.c | 24 +- source4/utils/net.c | 10 +- source4/utils/net_ads_cldap.c | 10 +- source4/utils/net_rap.c | 20 +- source4/utils/net_rpc.c | 34 +-- source4/utils/net_rpc_join.c | 12 +- source4/utils/net_rpc_samsync.c | 28 +- 127 files changed, 764 insertions(+), 781 deletions(-) diff --git a/source4/auth/auth_domain.c b/source4/auth/auth_domain.c index ff759539da6..a19d0f78464 100644 --- a/source4/auth/auth_domain.c +++ b/source4/auth/auth_domain.c @@ -130,7 +130,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, struct in_addr dest_ip; fstring remote_machine; NTSTATUS result; - uint32 neg_flags = 0x000001ff; + uint32_t neg_flags = 0x000001ff; *retry = False; diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4 index 8ea87e9fa4f..d99712c1261 100644 --- a/source4/build/m4/rewrite.m4 +++ b/source4/build/m4/rewrite.m4 @@ -364,6 +364,8 @@ AC_CHECK_TYPE(offset_t,loff_t) 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) diff --git a/source4/client/client.c b/source4/client/client.c index 77d4b4b497d..6599e143ddb 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -2208,7 +2208,7 @@ static int cmd_reput(void) /* 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: @@ -2253,7 +2253,7 @@ static BOOL browse_host(const char *query_host) 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; diff --git a/source4/include/MacExtensions.h b/source4/include/MacExtensions.h index d09370ed9f7..92376b2cf03 100644 --- a/source4/include/MacExtensions.h +++ b/source4/include/MacExtensions.h @@ -53,10 +53,10 @@ */ 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]; diff --git a/source4/include/byteorder.h b/source4/include/byteorder.h index 48b4cb81276..a1e161ba6cd 100644 --- a/source4/include/byteorder.h +++ b/source4/include/byteorder.h @@ -118,36 +118,36 @@ it also defines lots of intermediate macros, just ignore those :-) #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 */ diff --git a/source4/include/cli_context.h b/source4/include/cli_context.h index 9cd36d0c354..89f7826789b 100644 --- a/source4/include/cli_context.h +++ b/source4/include/cli_context.h @@ -53,12 +53,12 @@ struct cli_negotiate { 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; @@ -184,7 +184,7 @@ struct cli_session { uint16 vuid; /* default pid for this session */ - uint32 pid; + uint32_t pid; DATA_BLOB user_session_key; }; diff --git a/source4/include/context.h b/source4/include/context.h index 188f567e001..47dd67c813e 100644 --- a/source4/include/context.h +++ b/source4/include/context.h @@ -280,7 +280,7 @@ struct negotiate_context { BOOL spnego_negotiated; /* client capabilities */ - uint32 client_caps; + uint32_t client_caps; /* the timezone we sent to the client */ int zone_offset; diff --git a/source4/include/debug.h b/source4/include/debug.h index 8c82c735579..166b7c26f58 100644 --- a/source4/include/debug.h +++ b/source4/include/debug.h @@ -29,7 +29,7 @@ struct debug_ops { 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); diff --git a/source4/include/includes.h b/source4/include/includes.h index b6be02155e7..e6593754ed1 100644 --- a/source4/include/includes.h +++ b/source4/include/includes.h @@ -443,7 +443,7 @@ typedef int socklen_t; #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 @@ -473,40 +473,21 @@ typedef int socklen_t; #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 +#define int32 int32_t #endif -#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 -#endif -#endif - -#if !defined(uint64) -#define uint64 uint64_t +#define uint32 uint32_t #endif #if !defined(int64) #define int64 int64_t #endif +#if !defined(uint64) +#define uint64 uint64_t +#endif + /* * Types for devices, inodes and offsets. */ diff --git a/source4/include/md5.h b/source4/include/md5.h index 6665171e7c5..6f8b7d0c152 100644 --- a/source4/include/md5.h +++ b/source4/include/md5.h @@ -6,8 +6,8 @@ #endif struct MD5Context { - uint32 buf[4]; - uint32 bits[2]; + uint32_t buf[4]; + uint32_t bits[2]; unsigned char in[64]; }; diff --git a/source4/include/nameserv.h b/source4/include/nameserv.h index 90984774457..68cc9882801 100644 --- a/source4/include/nameserv.h +++ b/source4/include/nameserv.h @@ -293,7 +293,7 @@ struct work_record BOOL RunningElection; BOOL needelection; int ElectionCount; - uint32 ElectionCriterion; + uint32_t ElectionCriterion; /* Domain master browser info. Used for efficient syncs. */ struct nmb_name dmb_name; diff --git a/source4/include/nt_status.h b/source4/include/nt_status.h index d2cf1ceae4a..4e61d9a3650 100644 --- a/source4/include/nt_status.h +++ b/source4/include/nt_status.h @@ -35,21 +35,21 @@ */ #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 diff --git a/source4/include/smb.h b/source4/include/smb.h index 4f5a92b4ebf..ea8769681c4 100644 --- a/source4/include/smb.h +++ b/source4/include/smb.h @@ -264,7 +264,7 @@ typedef struct nt_user_token { /* 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 */ @@ -292,7 +292,7 @@ typedef struct userdom_struct { 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 */ @@ -357,7 +357,7 @@ struct connections_data { 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 */ @@ -396,7 +396,7 @@ struct parm_struct }; struct bitmap { - uint32 *b; + uint32_t *b; unsigned int n; }; diff --git a/source4/include/smb_interfaces.h b/source4/include/smb_interfaces.h index 73ee9e2e22a..39944f832e0 100644 --- a/source4/include/smb_interfaces.h +++ b/source4/include/smb_interfaces.h @@ -47,7 +47,7 @@ typedef uint64_t HYPER_T; is used in the structure definition. */ typedef struct { - uint32 private_length; + uint32_t private_length; const char *s; } WIRE_STRING; @@ -62,10 +62,10 @@ struct smb_seek { struct { uint16 fnum; uint16 mode; - int32 offset; /* signed */ + int32_t offset; /* signed */ } in; struct { - int32 offset; + int32_t offset; } out; }; @@ -146,7 +146,7 @@ union smb_rename { struct { uint16 attrib; uint16 flags; /* see RENAME_FLAG_* */ - uint32 cluster_size; + uint32_t cluster_size; const char *old_name; const char *new_name; } in; @@ -208,8 +208,8 @@ union smb_sesssetup { enum sesssetup_level level; struct { - uint32 sesskey; - uint32 capabilities; + uint32_t sesskey; + uint32_t capabilities; const char *password; const char *user; const char *domain; @@ -230,7 +230,7 @@ union smb_sesssetup { uint16 bufsize; uint16 mpx_max; uint16 vc_num; - uint32 sesskey; + uint32_t sesskey; DATA_BLOB password; const char *user; const char *domain; @@ -254,8 +254,8 @@ union smb_sesssetup { 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; @@ -281,8 +281,8 @@ union smb_sesssetup { 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; @@ -354,7 +354,7 @@ union smb_fileinfo { struct { uint16 attrib; - uint32 ea_size; + uint32_t ea_size; uint_t num_eas; struct ea_struct { uint8 flags; @@ -365,10 +365,10 @@ union smb_fileinfo { 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; @@ -379,11 +379,11 @@ union smb_fileinfo { 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; @@ -402,7 +402,7 @@ union smb_fileinfo { struct { uint16 attrib; - uint32 size; + uint32_t size; time_t write_time; } out; } getattr; @@ -416,8 +416,8 @@ union smb_fileinfo { 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; @@ -431,8 +431,8 @@ union smb_fileinfo { 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; @@ -446,10 +446,10 @@ union smb_fileinfo { 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; @@ -482,7 +482,7 @@ union smb_fileinfo { NTTIME access_time; NTTIME write_time; NTTIME change_time; - uint32 attrib; + uint32_t attrib; } out; } basic_info; @@ -495,7 +495,7 @@ union smb_fileinfo { struct { uint64_t alloc_size; uint64_t size; - uint32 nlink; + uint32_t nlink; BOOL delete_pending; BOOL directory; } out; @@ -507,7 +507,7 @@ union smb_fileinfo { union smb_fileinfo_in in; struct { - uint32 ea_size; + uint32_t ea_size; } out; } ea_info; @@ -531,13 +531,13 @@ union smb_fileinfo { 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; @@ -590,7 +590,7 @@ union smb_fileinfo { 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; @@ -625,7 +625,7 @@ union smb_fileinfo { union smb_fileinfo_in in; struct { - uint32 access_flags; /* seen 0x001f01ff from w2k3 */ + uint32_t access_flags; /* seen 0x001f01ff from w2k3 */ } out; } access_information; @@ -645,7 +645,7 @@ union smb_fileinfo { union smb_fileinfo_in in; struct { - uint32 mode; + uint32_t mode; } out; } mode_information; @@ -655,7 +655,7 @@ union smb_fileinfo { union smb_fileinfo_in in; struct { - uint32 alignment_requirement; + uint32_t alignment_requirement; } out; } alignment_information; @@ -671,7 +671,7 @@ union smb_fileinfo { NTTIME change_time; uint64_t alloc_size; uint64_t size; - uint32 attrib; + uint32_t attrib; } out; } network_open_information; @@ -682,8 +682,8 @@ union smb_fileinfo { union smb_fileinfo_in in; struct { - uint32 attrib; - uint32 reparse_tag; + uint32_t attrib; + uint32_t reparse_tag; } out; } attribute_tag_information; }; @@ -787,7 +787,7 @@ union smb_setfileinfo { NTTIME access_time; NTTIME write_time; NTTIME change_time; - uint32 attrib; + uint32_t attrib; } in; } basic_info; @@ -832,7 +832,7 @@ union smb_setfileinfo { struct { uint8 overwrite; - uint32 root_fid; + uint32_t root_fid; const char *new_name; } in; } rename_information; @@ -854,7 +854,7 @@ union smb_setfileinfo { struct { /* valid values seem to be 0, 2, 4 and 6 */ - uint32 mode; + uint32_t mode; } in; } mode_information; @@ -865,7 +865,7 @@ union smb_setfileinfo { 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; @@ -873,7 +873,7 @@ union smb_setfileinfo { 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; @@ -919,16 +919,16 @@ union smb_fsinfo { 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; @@ -955,10 +955,10 @@ union smb_fsinfo { 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; @@ -968,7 +968,7 @@ union smb_fsinfo { enum fsinfo_level level; struct { - uint32 serial_number; + uint32_t serial_number; WIRE_STRING volume_name; } out; } volume; @@ -979,7 +979,7 @@ union smb_fsinfo { struct { NTTIME create_time; - uint32 serial_number; + uint32_t serial_number; WIRE_STRING volume_name; } out; } volume_info; @@ -991,8 +991,8 @@ union smb_fsinfo { 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; @@ -1001,8 +1001,8 @@ union smb_fsinfo { enum fsinfo_level level; struct { - uint32 device_type; - uint32 characteristics; + uint32_t device_type; + uint32_t characteristics; } out; } device_info; @@ -1012,8 +1012,8 @@ union smb_fsinfo { 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; @@ -1050,8 +1050,8 @@ union smb_fsinfo { 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; @@ -1083,15 +1083,15 @@ union smb_open { 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; @@ -1099,12 +1099,12 @@ union smb_open { 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; @@ -1123,8 +1123,8 @@ union smb_open { 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; @@ -1134,12 +1134,12 @@ union smb_open { 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; @@ -1156,7 +1156,7 @@ union smb_open { uint16 fnum; uint16 attrib; time_t write_time; - uint32 size; + uint32_t size; uint16 rmode; } out; } open; @@ -1172,24 +1172,24 @@ union smb_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; @@ -1255,11 +1255,11 @@ union smb_read { struct { uint16 fnum; uint64_t offset; - uint32 size; + uint32_t size; } in; struct { char *data; - uint32 nread; + uint32_t nread; } out; } generic; @@ -1273,11 +1273,11 @@ union smb_read { uint64_t offset; uint16 maxcnt; uint16 mincnt; - uint32 timeout; + uint32_t timeout; } in; struct { char *data; - uint32 nread; + uint32_t nread; } out; } readbraw; @@ -1289,7 +1289,7 @@ union smb_read { struct { uint16 fnum; uint16 count; - uint32 offset; + uint32_t offset; uint16 remaining; } in; struct { @@ -1305,7 +1305,7 @@ union smb_read { struct { uint16 fnum; uint16 count; - uint32 offset; + uint32_t offset; uint16 remaining; } in; struct { @@ -1348,11 +1348,11 @@ union smb_write { struct { uint16 fnum; uint64_t offset; - uint32 count; + uint32_t count; const char *data; } in; struct { - uint32 nwritten; + uint32_t nwritten; } out; } generic; @@ -1364,12 +1364,12 @@ union smb_write { struct { uint16 fnum; uint16 count; - uint32 offset; + uint32_t offset; uint16 remaining; const char *data; } in; struct { - uint32 nwritten; + uint32_t nwritten; } out; } writeunlock; @@ -1380,7 +1380,7 @@ union smb_write { struct { uint16 fnum; uint16 count; - uint32 offset; + uint32_t offset; uint16 remaining; const char *data; } in; @@ -1398,11 +1398,11 @@ union smb_write { 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; @@ -1414,7 +1414,7 @@ union smb_write { struct { uint16 fnum; uint16 count; - uint32 offset; + uint32_t offset; time_t mtime; const char *data; } in; @@ -1453,8 +1453,8 @@ union smb_lock { struct { uint16 fnum; - uint32 count; - uint32 offset; + uint32_t count; + uint32_t offset; } in; } lock; @@ -1464,8 +1464,8 @@ union smb_lock { struct { uint16 fnum; - uint32 count; - uint32 offset; + uint32_t count; + uint32_t offset; } in; } unlock; @@ -1476,7 +1476,7 @@ union smb_lock { struct { uint16 fnum; uint16 mode; - uint32 timeout; + uint32_t timeout; uint16 ulock_cnt; uint16 lock_cnt; struct smb_lock_entry { @@ -1553,7 +1553,7 @@ union smb_lpq { time_t time; uint8 status; uint16 job; - uint32 size; + uint32_t size; char *user; } *queue; } out; @@ -1577,7 +1577,7 @@ union smb_ioctl { enum ioctl_level level; struct { uint16 fnum; - uint32 request; + uint32_t request; } in; struct { DATA_BLOB blob; @@ -1589,7 +1589,7 @@ union smb_ioctl { struct { enum ioctl_level level; struct { - uint32 function; + uint32_t function; uint16 fnum; BOOL fsctl; uint8 filter; @@ -1630,7 +1630,7 @@ struct smb_trans2 { uint16 max_data; uint8 max_setup; uint16 flags; - uint32 timeout; + uint32_t timeout; uint8 setup_count; uint16 *setup; const char *trans_name; /* SMBtrans only */ @@ -1650,9 +1650,9 @@ struct smb_trans2 { 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; @@ -1671,16 +1671,16 @@ struct smb_nttrans { /* 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; @@ -1729,7 +1729,7 @@ union smb_search_first { uint16 search_attrib; uint16 max_count; uint16 flags; - uint32 storage_type; + uint32_t storage_type; const char *pattern; } in; struct { @@ -1767,7 +1767,7 @@ union smb_search_next { struct { uint16 handle; uint16 max_count; - uint32 resume_key; + uint32_t resume_key; uint16 flags; const char *last_name; } in; @@ -1784,110 +1784,110 @@ union smb_search_data { 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; @@ -1895,7 +1895,7 @@ union smb_search_data { /* RAW_SEARCH_UNIX_INFO interface */ struct { - uint32 file_index; + uint32_t file_index; uint64_t size; uint64_t alloc_size; NTTIME status_change_time; @@ -1903,7 +1903,7 @@ union smb_search_data { 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; diff --git a/source4/include/smb_macros.h b/source4/include/smb_macros.h index 6f8ecd6c211..6dc78a17955 100644 --- a/source4/include/smb_macros.h +++ b/source4/include/smb_macros.h @@ -152,7 +152,7 @@ true if two IP addresses are equal 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. diff --git a/source4/lib/bitmap.c b/source4/lib/bitmap.c index 1023dd6541d..63b093617bf 100644 --- a/source4/lib/bitmap.c +++ b/source4/lib/bitmap.c @@ -35,7 +35,7 @@ struct bitmap *bitmap_allocate(int n) 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; @@ -73,7 +73,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n) 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; } diff --git a/source4/lib/crypto/crc32.c b/source4/lib/crypto/crc32.c index da3aeaa901d..f2d76332f96 100644 --- a/source4/lib/crypto/crc32.c +++ b/source4/lib/crypto/crc32.c @@ -55,9 +55,9 @@ static const unsigned long CRCTable[256] = 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>8) ^ CRCTable[(buffer[i] ^ crc) & 0xff]; crc^=0xffffffff; diff --git a/source4/lib/crypto/md4.c b/source4/lib/crypto/md4.c index 417e87bd8e2..cc8b9b68411 100644 --- a/source4/lib/crypto/md4.c +++ b/source4/lib/crypto/md4.c @@ -26,40 +26,40 @@ */ 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<>(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]; @@ -107,7 +107,7 @@ static void mdfour64(struct mdfour_state *s, uint32 *M) X[j] = 0; } -static void copy64(uint32 *M, const unsigned char *in) +static void copy64(uint32_t *M, const unsigned char *in) { int i; @@ -116,7 +116,7 @@ static void copy64(uint32 *M, const unsigned char *in) (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; @@ -128,8 +128,8 @@ static void copy4(unsigned char *out, uint32 x) 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; diff --git a/source4/lib/crypto/md5.c b/source4/lib/crypto/md5.c index 2121b170479..dbb3462bd4f 100644 --- a/source4/lib/crypto/md5.c +++ b/source4/lib/crypto/md5.c @@ -22,18 +22,18 @@ #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); } @@ -59,12 +59,12 @@ void MD5Init(struct MD5Context *ctx) */ 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; @@ -82,7 +82,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) } 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; } @@ -91,7 +91,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len) 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; } @@ -126,7 +126,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) /* 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); @@ -137,10 +137,10 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) 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 */ @@ -163,9 +163,9 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) * 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]; diff --git a/source4/lib/debug.c b/source4/lib/debug.c index dbd3946c81b..c9247f380f4 100644 --- a/source4/lib/debug.c +++ b/source4/lib/debug.c @@ -141,7 +141,7 @@ void print_suspicious_usage(const char* from, const char* info) } } -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(); diff --git a/source4/lib/genrand.c b/source4/lib/genrand.c index 9645dd7999b..a5002969bdb 100644 --- a/source4/lib/genrand.c +++ b/source4/lib/genrand.c @@ -23,7 +23,7 @@ #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; @@ -134,7 +134,7 @@ static void do_filehash(const char *fname, unsigned char *the_hash) 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) diff --git a/source4/lib/interface.c b/source4/lib/interface.c index 2540c898ffd..14abfbd09ad 100644 --- a/source4/lib/interface.c +++ b/source4/lib/interface.c @@ -28,7 +28,7 @@ struct in_addr loopback_ip; 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) diff --git a/source4/lib/messages.c b/source4/lib/messages.c index cb26b356bd4..9357b12f1fb 100644 --- a/source4/lib/messages.c +++ b/source4/lib/messages.c @@ -474,7 +474,7 @@ void message_deregister(int msg_type) struct msg_all { int msg_type; - uint32 msg_flag; + uint32_t msg_flag; const void *buf; size_t len; BOOL duplicates; diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index 6acedb3591c..6d305e61bf7 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -508,7 +508,7 @@ WERROR reg_key_add_name_recursive(REG_KEY *parent, const char *path) 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; diff --git a/source4/lib/registry/common/reg_objects.c b/source4/lib/registry/common/reg_objects.c index 168ee946e81..be15108f4d9 100644 --- a/source4/lib/registry/common/reg_objects.c +++ b/source4/lib/registry/common/reg_objects.c @@ -85,7 +85,7 @@ char *reg_val_name( REG_VAL *val ) /********************************************************************** *********************************************************************/ -uint32 reg_val_type( REG_VAL *val ) +uint32_t reg_val_type( REG_VAL *val ) { return val->data_type; } diff --git a/source4/lib/registry/common/reg_util.c b/source4/lib/registry/common/reg_util.c index 82b8d066798..353963f78d4 100644 --- a/source4/lib/registry/common/reg_util.c +++ b/source4/lib/registry/common/reg_util.c @@ -105,7 +105,7 @@ WERROR reg_key_get_subkey_val(REG_KEY *key, const char *subname, const char *val 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; diff --git a/source4/lib/registry/common/registry.h b/source4/lib/registry/common/registry.h index 5325a890866..caa0e284bfa 100644 --- a/source4/lib/registry/common/registry.h +++ b/source4/lib/registry/common/registry.h @@ -107,7 +107,7 @@ struct registry_ops { 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 */ diff --git a/source4/lib/registry/reg_backend_dir/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir/reg_backend_dir.c index c7ed95d80f2..cac54f8437f 100644 --- a/source4/lib/registry/reg_backend_dir/reg_backend_dir.c +++ b/source4/lib/registry/reg_backend_dir/reg_backend_dir.c @@ -21,7 +21,7 @@ #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; diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c index 415f764f613..627b5a8f13f 100644 --- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c +++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c @@ -501,7 +501,7 @@ static DWORD str_to_dword(const char *a) { /* * 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; diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c index d863568c175..28e2094bedd 100644 --- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c +++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c @@ -197,7 +197,7 @@ static WERROR rpc_get_value_by_index(REG_KEY *parent, int n, REG_VAL **value) 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); @@ -283,7 +283,7 @@ static WERROR rpc_get_subkey_by_index(REG_KEY *parent, int n, REG_KEY **subkey) 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; diff --git a/source4/lib/system.c b/source4/lib/system.c index 8c9627eb26b..2641a180ef3 100644 --- a/source4/lib/system.c +++ b/source4/lib/system.c @@ -410,7 +410,7 @@ struct hostent *sys_gethostbyname(const char *name) /************************************************************************** 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(); @@ -444,7 +444,7 @@ static BOOL set_process_capability( uint32 cap_flag, BOOL enable ) 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(); diff --git a/source4/lib/tdb/common/tdbutil.c b/source4/lib/tdb/common/tdbutil.c index 62841ddfc20..b8babf48aad 100644 --- a/source4/lib/tdb/common/tdbutil.c +++ b/source4/lib/tdb/common/tdbutil.c @@ -180,15 +180,15 @@ void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval) /**************************************************************************** - 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)) { @@ -202,25 +202,25 @@ int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len) } /**************************************************************************** - 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; @@ -230,21 +230,21 @@ int tdb_store_int32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, int } /**************************************************************************** - 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; @@ -261,25 +261,25 @@ BOOL tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len, u } /**************************************************************************** - 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); @@ -293,11 +293,11 @@ BOOL tdb_store_uint32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, u } /**************************************************************************** - 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); } @@ -340,10 +340,10 @@ int tdb_delete_bystring(TDB_CONTEXT *tdb, const char *keystr) 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; @@ -381,9 +381,9 @@ int32 tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32 *oldva 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) @@ -429,7 +429,7 @@ size_t tdb_pack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...) va_list ap; uint8 bt; uint16 w; - uint32 d; + uint32_t d; int i; void *p; int len; @@ -523,7 +523,7 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...) va_list ap; uint8 *bt; uint16 *w; - uint32 *d; + uint32_t *d; int len; int *i; void **p; @@ -553,7 +553,7 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...) 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); diff --git a/source4/lib/time.c b/source4/lib/time.c index e3811c884ef..99738d5a4a0 100644 --- a/source4/lib/time.c +++ b/source4/lib/time.c @@ -164,10 +164,10 @@ static uint16 make_dos_time1(struct tm *t) 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; @@ -192,7 +192,7 @@ This takes GMT time and puts local time in the buffer ********************************************************************/ 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); } @@ -202,7 +202,7 @@ This takes GMT time and puts local time in the buffer ********************************************************************/ 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); @@ -224,9 +224,9 @@ void push_dos_date3(char *buf,int offset,time_t unixdate, int zone_offset) /******************************************************************* 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; @@ -245,7 +245,7 @@ static void interpret_dos_date(uint32 date,int *year,int *month,int *day,int *ho ********************************************************************/ 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; @@ -269,7 +269,7 @@ like make_unix_date() but the words are reversed ********************************************************************/ 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); diff --git a/source4/lib/util.c b/source4/lib/util.c index 0cb5258a645..a4be8f8bf8f 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -426,10 +426,10 @@ BOOL is_ipaddress(const char *str) 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); @@ -454,7 +454,7 @@ uint32 interpret_addr(const char *str) putip((char *)&res,(char *)hp->h_addr); } - if (res == (uint32)-1) + if (res == (uint32_t)-1) return(0); return(res); @@ -467,7 +467,7 @@ uint32 interpret_addr(const char *str) 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; @@ -481,7 +481,7 @@ struct in_addr *interpret_addr2(TALLOC_CTX *mem_ctx, const char *str) BOOL is_zero_ip(struct in_addr ip) { - uint32 a; + uint32_t a; putip((char *)&a,(char *)&ip); return(a == 0); } @@ -503,7 +503,7 @@ void zero_ip(struct in_addr *ip) 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); diff --git a/source4/lib/util_sid.c b/source4/lib/util_sid.c index 56f5abd6111..2a706253179 100644 --- a/source4/lib/util_sid.c +++ b/source4/lib/util_sid.c @@ -78,7 +78,7 @@ static const struct { {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; @@ -147,7 +147,7 @@ void generate_wellknown_sids(void) 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; @@ -164,7 +164,7 @@ BOOL sid_peek_rid(const struct dom_sid *sid, uint32 *rid) 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; @@ -285,7 +285,7 @@ size_t sid_size(const struct dom_sid *sid) if (sid == NULL) return 0; - return sid->num_auths * sizeof(uint32) + 8; + return sid->num_auths * sizeof(uint32_t) + 8; } /***************************************************************** diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c index 57d3715cfc0..999aeae744d 100644 --- a/source4/lib/util_sock.c +++ b/source4/lib/util_sock.c @@ -250,7 +250,7 @@ BOOL send_nbt_keepalive(int sock_fd) /**************************************************************************** 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; diff --git a/source4/libads/ads_ldap.c b/source4/libads/ads_ldap.c index 944cb1599cc..b9e07e4c33e 100644 --- a/source4/libads/ads_ldap.c +++ b/source4/libads/ads_ldap.c @@ -35,7 +35,7 @@ NTSTATUS ads_name_to_sid(ADS_STRUCT *ads, 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); @@ -70,7 +70,7 @@ NTSTATUS ads_name_to_sid(ADS_STRUCT *ads, 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; } @@ -104,7 +104,7 @@ NTSTATUS ads_sid_to_name(ADS_STRUCT *ads, 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))) { @@ -126,7 +126,7 @@ NTSTATUS ads_sid_to_name(ADS_STRUCT *ads, goto done; } - if (!ads_pull_uint32(ads, msg, "sAMAccountType", &atype)) { + if (!ads_pull_uint32_t(ads, msg, "sAMAccountType", &atype)) { goto done; } diff --git a/source4/libads/ads_status.c b/source4/libads/ads_status.c index 463f647f9c7..9ad07bce99f 100644 --- a/source4/libads/ads_status.c +++ b/source4/libads/ads_status.c @@ -96,7 +96,7 @@ NTSTATUS ads_ntstatus(ADS_STATUS status) */ const char *ads_errstr(ADS_STATUS status) { - uint32 msg_ctx; + uint32_t msg_ctx; static char *ret; SAFE_FREE(ret); @@ -116,7 +116,7 @@ const char *ads_errstr(ADS_STATUS status) #ifdef HAVE_GSSAPI case ENUM_ADS_ERROR_GSS: { - uint32 minor; + uint32_t minor; gss_buffer_desc msg1, msg2; msg1.value = NULL; diff --git a/source4/libads/disp_sec.c b/source4/libads/disp_sec.c index c9de447e698..0d8954a9784 100644 --- a/source4/libads/disp_sec.c +++ b/source4/libads/disp_sec.c @@ -21,7 +21,7 @@ #include "includes.h" static struct perm_mask_str { - uint32 mask; + uint32_t mask; const char *str; } perms[] = { {SEC_RIGHTS_FULL_CTRL, "[Full Control]"}, @@ -50,7 +50,7 @@ static struct perm_mask_str { }; /* 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; diff --git a/source4/libads/ldap.c b/source4/libads/ldap.c index 8039d3d1d40..9161c356923 100644 --- a/source4/libads/ldap.c +++ b/source4/libads/ldap.c @@ -985,7 +985,7 @@ char *ads_ou_string(const char *org_unit) 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; @@ -1107,7 +1107,7 @@ static void dump_binary(const char *field, struct berval **values) } struct uuid { - uint32 i1; + uint32_t i1; uint16 i2; uint16 i3; uint8 s[8]; @@ -1314,7 +1314,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) * @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; @@ -1737,15 +1737,15 @@ char **ads_pull_strings_range(ADS_STRUCT *ads, } /** - * 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; @@ -1921,7 +1921,7 @@ char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, void *msg) * @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; @@ -1935,7 +1935,7 @@ ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn) 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; } diff --git a/source4/libads/ldap_printer.c b/source4/libads/ldap_printer.c index 1448074ea02..dee53e5f1af 100644 --- a/source4/libads/ldap_printer.c +++ b/source4/libads/ldap_printer.c @@ -118,7 +118,7 @@ static BOOL map_dword(TALLOC_CTX *ctx, ADS_MODLIST *mods, 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); } @@ -148,7 +148,7 @@ static BOOL map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods, { 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) @@ -268,7 +268,7 @@ WERROR get_remote_printer_publishing_data(struct cli_state *cli, 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); @@ -341,7 +341,7 @@ BOOL get_local_printer_publishing_data(TALLOC_CTX *mem_ctx, 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; diff --git a/source4/libads/sasl.c b/source4/libads/sasl.c index 1ab71c6ee51..e4c33aec4cf 100644 --- a/source4/libads/sasl.c +++ b/source4/libads/sasl.c @@ -33,7 +33,7 @@ static ADS_STATUS ads_sasl_spnego_ntlmssp_bind(ADS_STRUCT *ads) 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; @@ -234,19 +234,19 @@ failed: */ 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; diff --git a/source4/libads/util.c b/source4/libads/util.c index f8c9a312bbc..f7dc2197900 100644 --- a/source4/libads/util.c +++ b/source4/libads/util.c @@ -29,7 +29,7 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip 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)); diff --git a/source4/libcli/auth/credentials.c b/source4/libcli/auth/credentials.c index 5fa9d5ac4a3..139b17d5b33 100644 --- a/source4/libcli/auth/credentials.c +++ b/source4/libcli/auth/credentials.c @@ -34,7 +34,7 @@ static void creds_init(struct creds_CredentialState *creds, 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)); diff --git a/source4/libcli/auth/credentials.h b/source4/libcli/auth/credentials.h index a7e81d43af1..85efd54bc18 100644 --- a/source4/libcli/auth/credentials.h +++ b/source4/libcli/auth/credentials.h @@ -22,7 +22,7 @@ struct creds_CredentialState { uint8 session_key[8]; - uint32 sequence; + uint32_t sequence; struct netr_Credential seed; struct netr_Credential client; struct netr_Credential server; diff --git a/source4/libcli/auth/ntlmssp.c b/source4/libcli/auth/ntlmssp.c index 3773c8e590b..54b219f8794 100644 --- a/source4/libcli/auth/ntlmssp.c +++ b/source4/libcli/auth/ntlmssp.c @@ -62,7 +62,7 @@ static const struct ntlmssp_callbacks { * @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)); @@ -222,7 +222,7 @@ NTSTATUS ntlmssp_update(NTLMSSP_STATE *ntlmssp_state, const DATA_BLOB in, DATA_BLOB *out) { DATA_BLOB input; - uint32 ntlmssp_command; + uint32_t ntlmssp_command; int i; *out = data_blob(NULL, 0); @@ -317,7 +317,7 @@ void ntlmssp_end(NTLMSSP_STATE **ntlmssp_state) */ 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; @@ -335,7 +335,7 @@ static const char *ntlmssp_target_name(struct ntlmssp_state *ntlmssp_state, } 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; @@ -427,8 +427,8 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state, { 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; @@ -545,7 +545,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state, 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]; @@ -978,7 +978,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state, 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); diff --git a/source4/libcli/auth/ntlmssp.h b/source4/libcli/auth/ntlmssp.h index d3d39e8465a..95713de6c56 100644 --- a/source4/libcli/auth/ntlmssp.h +++ b/source4/libcli/auth/ntlmssp.h @@ -77,7 +77,7 @@ typedef struct ntlmssp_state 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; @@ -103,7 +103,7 @@ typedef struct ntlmssp_state 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; @@ -163,7 +163,7 @@ typedef struct ntlmssp_state /* SMB Signing */ - uint32 ntlmssp_seq_num; + uint32_t ntlmssp_seq_num; /* ntlmv2 */ char send_sign_key[16]; diff --git a/source4/libcli/auth/ntlmssp_parse.c b/source4/libcli/auth/ntlmssp_parse.c index 6ddaeebb06f..6d0d644a89a 100644 --- a/source4/libcli/auth/ntlmssp_parse.c +++ b/source4/libcli/auth/ntlmssp_parse.c @@ -191,8 +191,8 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, 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); @@ -296,7 +296,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, 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; diff --git a/source4/libcli/auth/ntlmssp_sign.c b/source4/libcli/auth/ntlmssp_sign.c index 6abec7e8b6d..df7bddcd38d 100644 --- a/source4/libcli/auth/ntlmssp_sign.c +++ b/source4/libcli/auth/ntlmssp_sign.c @@ -159,7 +159,7 @@ static NTSTATUS ntlmssp_make_packet_signature(NTLMSSP_STATE *ntlmssp_state, 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; @@ -302,7 +302,7 @@ NTSTATUS ntlmssp_seal_packet(NTLMSSP_STATE *ntlmssp_state, 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; diff --git a/source4/libcli/auth/schannel.h b/source4/libcli/auth/schannel.h index 7b710d7cb98..74507c547d6 100644 --- a/source4/libcli/auth/schannel.h +++ b/source4/libcli/auth/schannel.h @@ -25,7 +25,7 @@ struct schannel_state { TALLOC_CTX *mem_ctx; uint8 session_key[16]; - uint32 seq_num; + uint32_t seq_num; BOOL initiator; DATA_BLOB signature; }; diff --git a/source4/libcli/clifile.c b/source4/libcli/clifile.c index d1dd0b4ff2f..803e27699f7 100644 --- a/source4/libcli/clifile.c +++ b/source4/libcli/clifile.c @@ -51,7 +51,7 @@ static NTSTATUS cli_link_internal(struct cli_tree *tree, /**************************************************************************** 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; @@ -100,8 +100,8 @@ NTSTATUS cli_unix_hardlink(struct cli_tree *tree, const char *fname_src, ****************************************************************************/ 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; @@ -136,7 +136,7 @@ NTSTATUS cli_unix_chown(struct cli_tree *tree, const char *fname, uid_t uid, 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); } @@ -224,9 +224,9 @@ NTSTATUS cli_nt_delete_on_close(struct cli_tree *tree, int fnum, BOOL flag) 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; @@ -347,7 +347,7 @@ NTSTATUS cli_close(struct cli_tree *tree, int fnum) 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; @@ -375,7 +375,7 @@ NTSTATUS cli_locktype(struct cli_tree *tree, int fnum, 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; @@ -402,7 +402,7 @@ NTSTATUS cli_lock(struct cli_tree *tree, int fnum, /**************************************************************************** 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]; diff --git a/source4/libcli/raw/clikrb5.c b/source4/libcli/raw/clikrb5.c index 1d9c02f7f4e..0d4fade2953 100644 --- a/source4/libcli/raw/clikrb5.c +++ b/source4/libcli/raw/clikrb5.c @@ -37,10 +37,10 @@ /* * 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) diff --git a/source4/libcli/raw/raweas.c b/source4/libcli/raw/raweas.c index ce0368c304d..f265c8281d3 100644 --- a/source4/libcli/raw/raweas.c +++ b/source4/libcli/raw/raweas.c @@ -42,7 +42,7 @@ uint_t ea_list_size(uint_t num_eas, struct ea_struct *eas) 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); @@ -105,7 +105,7 @@ NTSTATUS ea_pull_list(const DATA_BLOB *blob, 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; diff --git a/source4/libcli/raw/rawnotify.c b/source4/libcli/raw/rawnotify.c index 7d635da0dc7..1030a61704f 100644 --- a/source4/libcli/raw/rawnotify.c +++ b/source4/libcli/raw/rawnotify.c @@ -51,7 +51,7 @@ NTSTATUS smb_raw_changenotify_recv(struct cli_request *req, { 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); @@ -64,7 +64,7 @@ NTSTATUS smb_raw_changenotify_recv(struct cli_request *req, /* 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; diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index 085b445fbab..d8e4d80b390 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -153,7 +153,7 @@ struct cli_request *cli_request_setup_session(struct cli_session *session, { struct cli_request *req; uint16 flags2; - uint32 capabilities; + uint32_t capabilities; req = cli_request_setup_transport(session->transport, command, wct, buflen); @@ -798,7 +798,7 @@ DATA_BLOB cli_req_pull_blob(struct cli_request *req, TALLOC_CTX *mem_ctx, const /* 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 || diff --git a/source4/libcli/raw/rawtrans.c b/source4/libcli/raw/rawtrans.c index 1fd91b29d77..d13a1227dd0 100644 --- a/source4/libcli/raw/rawtrans.c +++ b/source4/libcli/raw/rawtrans.c @@ -320,8 +320,8 @@ NTSTATUS smb_raw_nttrans_recv(struct cli_request *req, 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)) { @@ -369,9 +369,9 @@ NTSTATUS smb_raw_nttrans_recv(struct cli_request *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); diff --git a/source4/libcli/raw/smb_signing.c b/source4/libcli/raw/smb_signing.c index 5f47a5e42a7..bb295ee991c 100644 --- a/source4/libcli/raw/smb_signing.c +++ b/source4/libcli/raw/smb_signing.c @@ -24,7 +24,7 @@ struct smb_basic_signing_context { DATA_BLOB mac_key; - uint32 next_seq_num; + uint32_t next_seq_num; }; /*********************************************************** diff --git a/source4/libcli/util/clierror.c b/source4/libcli/util/clierror.c index 97436d21062..7b78d191ddc 100644 --- a/source4/libcli/util/clierror.c +++ b/source4/libcli/util/clierror.c @@ -75,7 +75,7 @@ NTSTATUS cli_nt_error(struct cli_tree *tree) /* 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, diff --git a/source4/libcli/util/dom_sid.c b/source4/libcli/util/dom_sid.c index dbc9c20155b..88ece25a8eb 100644 --- a/source4/libcli/util/dom_sid.c +++ b/source4/libcli/util/dom_sid.c @@ -59,7 +59,7 @@ struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr) 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; } diff --git a/source4/libcli/util/errormap.c b/source4/libcli/util/errormap.c index a257c2d0ea3..11a07d45c78 100644 --- a/source4/libcli/util/errormap.c +++ b/source4/libcli/util/errormap.c @@ -47,7 +47,7 @@ /* 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}, @@ -613,7 +613,7 @@ static const struct { /* 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}, @@ -1410,7 +1410,7 @@ static const struct { /***************************************************************************** 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; @@ -1427,7 +1427,7 @@ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode) /***************************************************************************** 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)) { diff --git a/source4/libcli/util/smbencrypt.c b/source4/libcli/util/smbencrypt.c index edf1526d2e3..b31f62c727c 100644 --- a/source4/libcli/util/smbencrypt.c +++ b/source4/libcli/util/smbencrypt.c @@ -461,7 +461,7 @@ BOOL encode_pw_buffer(char buffer[516], const char *password, int string_flags) 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; diff --git a/source4/librpc/idl/mgmt.idl b/source4/librpc/idl/mgmt.idl index 7e691d3c31b..0756e360105 100644 --- a/source4/librpc/idl/mgmt.idl +++ b/source4/librpc/idl/mgmt.idl @@ -16,7 +16,7 @@ interface mgmt } dcerpc_syntax_id_p; typedef struct { - unsigned32 count; + uint32 count; [size_is(count)] dcerpc_syntax_id_p if_id[*]; } rpc_if_id_vector_t; diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 97f36b78d0c..9650c1aca66 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -26,7 +26,7 @@ /* 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; }; @@ -40,10 +40,10 @@ struct ndr_ofs_list { 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. @@ -52,21 +52,21 @@ struct ndr_pull { }; 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 */ @@ -77,16 +77,16 @@ struct ndr_push { }; 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; }; @@ -176,7 +176,7 @@ enum ndr_err_code { #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) @@ -233,11 +233,11 @@ typedef NTSTATUS (*ndr_pull_fn_t)(struct ndr_pull *, void *); 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" diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 205607e0cd6..3394231726c 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -34,7 +34,7 @@ /* 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)); @@ -63,7 +63,7 @@ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx) 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; @@ -78,7 +78,7 @@ NTSTATUS ndr_pull_subcontext(struct ndr_pull *ndr, struct ndr_pull *ndr2, uint32 /* 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) { @@ -92,7 +92,7 @@ NTSTATUS ndr_pull_advance(struct ndr_pull *ndr, uint32 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) { @@ -177,7 +177,7 @@ DATA_BLOB ndr_push_blob(struct ndr_push *ndr) /* 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; @@ -199,7 +199,7 @@ NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32 size) /* 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; @@ -210,7 +210,7 @@ NTSTATUS ndr_push_set_offset(struct ndr_push *ndr, uint32 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; @@ -235,7 +235,7 @@ done: 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; @@ -262,7 +262,7 @@ done: 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; @@ -322,9 +322,9 @@ void ndr_print_debug(void (*fn)(struct ndr_print *, const char *, void *), /* 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; @@ -419,7 +419,7 @@ static NTSTATUS ndr_pull_subcontext_header(struct ndr_pull *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; @@ -434,7 +434,7 @@ static NTSTATUS ndr_pull_subcontext_header(struct ndr_pull *ndr, } 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)); @@ -488,9 +488,9 @@ NTSTATUS ndr_pull_subcontext_flags_fn(struct ndr_pull *ndr, 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; @@ -577,9 +577,9 @@ NTSTATUS ndr_push_subcontext_flags_fn(struct ndr_push *ndr, */ 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; @@ -644,7 +644,7 @@ NTSTATUS ndr_pull_relative(struct ndr_pull *ndr, const void **buf, size_t size, 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; @@ -719,8 +719,8 @@ NTSTATUS ndr_push_relative(struct ndr_push *ndr, int ndr_flags, const 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); diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index f4cdf44dc04..5b20f118f75 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -54,9 +54,9 @@ NTSTATUS ndr_pull_uint16(struct ndr_pull *ndr, uint16 *v) /* - 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); @@ -100,7 +100,7 @@ NTSTATUS ndr_pull_HYPER_T(struct ndr_pull *ndr, HYPER_T *v) */ 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; @@ -124,7 +124,7 @@ void ndr_print_NTSTATUS(struct ndr_print *ndr, const char *name, NTSTATUS *r) */ 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; @@ -146,7 +146,7 @@ void ndr_print_WERROR(struct ndr_print *ndr, const char *name, WERROR *r) /* 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); @@ -157,7 +157,7 @@ NTSTATUS ndr_pull_bytes(struct ndr_pull *ndr, char *data, uint32 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; @@ -169,9 +169,9 @@ NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, char *data, u /* 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; } @@ -182,11 +182,11 @@ NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, int ndr_flags, uint16 *data } /* - 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; } @@ -220,9 +220,9 @@ NTSTATUS ndr_push_uint16(struct ndr_push *ndr, uint16 v) } /* - 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); @@ -276,7 +276,7 @@ NTSTATUS ndr_pull_align(struct ndr_pull *ndr, size_t size) /* 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); @@ -287,7 +287,7 @@ NTSTATUS ndr_push_bytes(struct ndr_push *ndr, const char *data, uint32 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); @@ -298,7 +298,7 @@ NTSTATUS ndr_push_zero(struct ndr_push *ndr, uint32 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; @@ -309,7 +309,7 @@ NTSTATUS ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const char *d /* 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)) { @@ -322,9 +322,9 @@ NTSTATUS ndr_push_array_uint16(struct ndr_push *ndr, int ndr_flags, const uint16 } /* - 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)) { @@ -357,7 +357,7 @@ void ndr_push_restore(struct ndr_push *ndr, struct ndr_push_save *save) */ 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 @@ -375,7 +375,7 @@ NTSTATUS ndr_push_ptr(struct ndr_push *ndr, const void *p) 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; @@ -666,7 +666,7 @@ NTSTATUS ndr_push_time_t(struct ndr_push *ndr, time_t t) */ 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; @@ -688,27 +688,27 @@ void ndr_print_uint16(struct ndr_print *ndr, const char *name, uint16 v) 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) @@ -754,7 +754,7 @@ void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16 level) } 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; @@ -772,7 +772,7 @@ void ndr_print_array_uint32(struct ndr_print *ndr, const char *name, } 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; @@ -790,7 +790,7 @@ void ndr_print_array_uint16(struct ndr_print *ndr, const char *name, } 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; @@ -822,10 +822,10 @@ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name, */ 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", @@ -904,7 +904,7 @@ NTSTATUS ndr_push_DATA_BLOB(struct ndr_push *ndr, DATA_BLOB blob) */ 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) { diff --git a/source4/librpc/ndr/ndr_sec.c b/source4/librpc/ndr/ndr_sec.c index 8c1c0c55978..0c3982f3902 100644 --- a/source4/librpc/ndr/ndr_sec.c +++ b/source4/librpc/ndr/ndr_sec.c @@ -29,7 +29,7 @@ */ 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; } @@ -56,7 +56,7 @@ NTSTATUS ndr_push_dom_sid2(struct ndr_push *ndr, int ndr_flags, struct dom_sid * 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) { @@ -110,7 +110,7 @@ size_t ndr_size_dom_sid(struct dom_sid *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; @@ -118,11 +118,11 @@ struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx, 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; diff --git a/source4/librpc/ndr/ndr_sec.h b/source4/librpc/ndr/ndr_sec.h index 728d46535d8..1578fde3d7c 100644 --- a/source4/librpc/ndr/ndr_sec.h +++ b/source4/librpc/ndr/ndr_sec.h @@ -39,7 +39,7 @@ struct smb_query_secdesc { struct { uint16 fnum; - uint32 secinfo_flags; + uint32_t secinfo_flags; } in; struct { struct security_descriptor *sd; @@ -50,7 +50,7 @@ struct smb_query_secdesc { struct smb_set_secdesc { struct { uint16 fnum; - uint32 secinfo_flags; + uint32_t secinfo_flags; struct security_descriptor *sd; } in; }; diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c index d8a3f6a07e3..aa91a27ab77 100644 --- a/source4/librpc/ndr/ndr_spoolss_buf.c +++ b/source4/librpc/ndr/ndr_spoolss_buf.c @@ -25,7 +25,7 @@ #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; @@ -42,7 +42,7 @@ NTSTATUS pull_spoolss_PrinterInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, } 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; @@ -59,7 +59,7 @@ NTSTATUS pull_spoolss_FormInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, } 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; @@ -76,7 +76,7 @@ NTSTATUS pull_spoolss_JobInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, } 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; diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index e4c5174af34..0e3ceaf757f 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -469,7 +469,7 @@ NTSTATUS dcerpc_request(struct dcerpc_pipe *p, 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; @@ -560,7 +560,7 @@ NTSTATUS dcerpc_request(struct dcerpc_pipe *p, /* 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)) { @@ -764,7 +764,7 @@ static NTSTATUS dcerpc_ndr_validate_out(TALLOC_CTX *mem_ctx, 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 *), diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h index 25c2029f341..6afde2deb04 100644 --- a/source4/librpc/rpc/dcerpc.h +++ b/source4/librpc/rpc/dcerpc.h @@ -47,9 +47,9 @@ struct dcerpc_security { 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; @@ -67,7 +67,7 @@ struct dcerpc_pipe { } transport; /* the last fault code from a DCERPC fault */ - uint32 last_fault_code; + uint32_t last_fault_code; }; /* dcerpc pipe flags */ @@ -99,15 +99,15 @@ struct dcerpc_interface_call { }; 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; }; @@ -118,5 +118,5 @@ struct dcerpc_binding { enum dcerpc_transport_t transport; const char *host; const char **options; - uint32 flags; + uint32_t flags; }; diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index f368ce30b3a..f511ecb8196 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -90,7 +90,7 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p, 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; diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c index 3d646944ac5..070f5548003 100644 --- a/source4/librpc/rpc/dcerpc_smb.c +++ b/source4/librpc/rpc/dcerpc_smb.c @@ -105,7 +105,7 @@ static NTSTATUS dcerpc_raw_recv(struct dcerpc_pipe *p, /* 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; @@ -169,8 +169,8 @@ static NTSTATUS smb_secondary_request(struct dcerpc_pipe *p, { 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); diff --git a/source4/librpc/rpc/dcerpc_tcp.c b/source4/librpc/rpc/dcerpc_tcp.c index 1b016b89578..05c700ea891 100644 --- a/source4/librpc/rpc/dcerpc_tcp.c +++ b/source4/librpc/rpc/dcerpc_tcp.c @@ -26,7 +26,7 @@ struct tcp_private { int fd; char *server_name; - uint32 port; + uint32_t port; }; @@ -47,7 +47,7 @@ static NTSTATUS tcp_raw_recv(struct dcerpc_pipe *p, { 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); @@ -171,7 +171,7 @@ static const char *tcp_peer_name(struct dcerpc_pipe *p) */ NTSTATUS dcerpc_pipe_open_tcp(struct dcerpc_pipe **p, const char *server, - uint32 port) + uint32_t port) { struct tcp_private *tcp; int fd; diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index dce325d7e18..50224491824 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -53,7 +53,7 @@ size_t ndr_size_epm_towers(struct epm_towers *towers) */ 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; @@ -160,7 +160,7 @@ NTSTATUS dcerpc_epm_map_tcp_port(const char *server, /* 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++) { @@ -175,7 +175,7 @@ const char *idl_pipe_name(const char *uuid, uint32 if_version) /* 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++) { @@ -271,7 +271,7 @@ static const struct { static const struct { const char *name; - uint32 flag; + uint32_t flag; } ncacn_options[] = { {"sign", DCERPC_SIGN}, {"seal", DCERPC_SEAL}, @@ -429,7 +429,7 @@ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_ 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) @@ -514,13 +514,13 @@ done: 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]); @@ -574,7 +574,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_ip_tcp(struct dcerpc_pipe **p, 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) @@ -606,7 +606,7 @@ NTSTATUS dcerpc_pipe_connect_b(struct dcerpc_pipe **p, 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) @@ -642,7 +642,7 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **p, 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; diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 1c02e8fadc8..635b14b8215 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -54,7 +54,7 @@ struct ipc_private { 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; diff --git a/source4/ntvfs/reference/ref_util.c b/source4/ntvfs/reference/ref_util.c index 8234944ebd4..75f3ac49481 100644 --- a/source4/ntvfs/reference/ref_util.c +++ b/source4/ntvfs/reference/ref_util.c @@ -133,7 +133,7 @@ struct svfs_dir *svfs_list(TALLOC_CTX *mem_ctx, struct request_context *req, con /* 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; diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 1ee1ef157eb..199ae5f3c2f 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -2193,7 +2193,7 @@ static BOOL handle_copy(const char *pszParmValue, char **ptr) 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) { @@ -2223,7 +2223,7 @@ BOOL lp_winbind_gid(gid_t *low, gid_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; @@ -2241,7 +2241,7 @@ BOOL lp_non_unix_account_range(uint32 *low, uint32 *high) 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; @@ -2258,7 +2258,7 @@ static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr) 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; @@ -2279,7 +2279,7 @@ static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr) 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; diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index fc86e0f8c1a..1d16b8fe616 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -27,7 +27,7 @@ */ /* 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; } @@ -43,13 +43,13 @@ const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_con } /* 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; } diff --git a/source4/rpc_server/common/share_info.c b/source4/rpc_server/common/share_info.c index b5443533041..eae11b0f408 100644 --- a/source4/rpc_server/common/share_info.c +++ b/source4/rpc_server/common/share_info.c @@ -27,9 +27,9 @@ */ /* 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(); } @@ -44,25 +44,25 @@ const char *dcesrv_common_get_share_comment(TALLOC_CTX *mem_ctx, struct dcesrv_c } /* 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 @@ -88,13 +88,13 @@ const char *dcesrv_common_get_share_password(TALLOC_CTX *mem_ctx, struct dcesrv_ } /* 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; } diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index b89bec40bbb..350621aa6b0 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -100,7 +100,7 @@ static const struct dcesrv_interface *find_interface(const struct dcesrv_endpoin 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; @@ -117,7 +117,7 @@ static BOOL interface_match_by_uuid(const struct dcesrv_interface *iface, 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) { @@ -347,7 +347,7 @@ static void dcesrv_init_hdr(struct dcerpc_packet *pkt) /* 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; @@ -386,7 +386,7 @@ static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32 fault_code) /* 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; @@ -426,11 +426,11 @@ static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32 reason) 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) { @@ -558,7 +558,7 @@ static NTSTATUS dcesrv_request(struct dcesrv_call_state *call) void *r; NTSTATUS status; DATA_BLOB stub; - uint32 total_length; + uint32_t total_length; if (!call->conn->iface) { @@ -619,7 +619,7 @@ static NTSTATUS dcesrv_request(struct dcesrv_call_state *call) total_length = stub.length; do { - uint32 length; + uint32_t length; struct dcesrv_call_reply *rep; struct dcerpc_packet pkt; @@ -688,7 +688,7 @@ static BOOL dce_full_packet(const DATA_BLOB *data) /* 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; @@ -761,7 +761,7 @@ NTSTATUS dcesrv_input_process(struct dcesrv_connection *dce_conn) /* 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) { diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 5f61167906f..2d833ebd582 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -39,7 +39,7 @@ struct dcesrv_ep_description { enum endpoint_type type; union { const char *smb_pipe; - uint32 tcp_port; + uint32_t tcp_port; } info; }; @@ -79,7 +79,7 @@ struct dcesrv_call_state { } *replies; /* this is used by the boilerplate code to generate DCERPC faults */ - uint32 fault_code; + uint32_t fault_code; }; #define DCESRV_HANDLE_ANY 255 @@ -117,7 +117,7 @@ struct dcesrv_connection { 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; @@ -149,7 +149,7 @@ struct dcesrv_endpoint_server { * 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 diff --git a/source4/rpc_server/dcerpc_tcp.c b/source4/rpc_server/dcerpc_tcp.c index 869ee1cb644..e349de6194a 100644 --- a/source4/rpc_server/dcerpc_tcp.c +++ b/source4/rpc_server/dcerpc_tcp.c @@ -191,7 +191,7 @@ void init_rpc_session(struct event_context *ev, void *private, int fd) */ 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) { diff --git a/source4/rpc_server/epmapper/rpc_epmapper.c b/source4/rpc_server/epmapper/rpc_epmapper.c index 7bfeaf2feea..b5113a881b4 100644 --- a/source4/rpc_server/epmapper/rpc_epmapper.c +++ b/source4/rpc_server/epmapper/rpc_epmapper.c @@ -31,7 +31,7 @@ struct dcesrv_ep_iface { const char *name; struct dcesrv_ep_description ep_description; const char *uuid; - uint32 if_version; + uint32_t if_version; }; /* @@ -112,12 +112,12 @@ static BOOL fill_protocol_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr, /* 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; @@ -165,10 +165,10 @@ static NTSTATUS epm_Lookup(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c { 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); @@ -240,7 +240,7 @@ static NTSTATUS epm_Lookup(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_c 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; diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index d4e60771ba5..f6b758ad98e 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -30,7 +30,7 @@ struct server_pipe_state { 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; }; @@ -139,10 +139,10 @@ static NTSTATUS netr_ServerAuthenticateInternals(struct server_pipe_state *pipe_ 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; diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index 710c2f514a0..78569082367 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -154,7 +154,7 @@ static BOOL remote_fill_interface(struct dcesrv_interface *iface, const struct d 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; diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 7592c479fa5..1ffda9795be 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -405,7 +405,7 @@ static NTSTATUS samr_CreateDomainGroup(struct dcesrv_call_state *dce_call, TALLO 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; @@ -549,7 +549,7 @@ static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX 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; @@ -718,7 +718,7 @@ static NTSTATUS samr_CreateUser(struct dcesrv_call_state *dce_call, TALLOC_CTX * struct samr_CreateUser *r) { struct samr_CreateUser2 r2; - uint32 access_granted; + uint32_t access_granted; /* a simple wrapper around samr_CreateUser2 works nicely */ @@ -873,8 +873,8 @@ static NTSTATUS samr_LookupNames(struct dcesrv_call_state *dce_call, TALLOC_CTX 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; } @@ -885,7 +885,7 @@ static NTSTATUS samr_LookupNames(struct dcesrv_call_state *dce_call, TALLOC_CTX 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; diff --git a/source4/rpc_server/samr/dcesrv_samr.h b/source4/rpc_server/samr/dcesrv_samr.h index 980bb5e9cde..205e1072079 100644 --- a/source4/rpc_server/samr/dcesrv_samr.h +++ b/source4/rpc_server/samr/dcesrv_samr.h @@ -39,7 +39,7 @@ struct samr_connect_state { int reference_count; void *sam_ctx; TALLOC_CTX *mem_ctx; - uint32 access_mask; + uint32_t access_mask; }; /* @@ -50,7 +50,7 @@ struct samr_domain_state { 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; @@ -63,7 +63,7 @@ struct samr_account_state { 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; diff --git a/source4/rpc_server/samr/samdb.c b/source4/rpc_server/samr/samdb.c index 36aa8be4d42..98374c6c86c 100644 --- a/source4/rpc_server/samr/samdb.c +++ b/source4/rpc_server/samr/samdb.c @@ -334,8 +334,8 @@ const char *samdb_result_string(struct ldb_message *msg, const char *attr, /* 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); @@ -625,7 +625,7 @@ int samdb_copy_template(void *ctx, TALLOC_CTX *mem_ctx, 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; @@ -696,7 +696,7 @@ static NTSTATUS _samdb_allocate_next_id(void *ctx, TALLOC_CTX *mem_ctx, const ch 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; @@ -824,7 +824,7 @@ int samdb_msg_add_hashes(void *ctx, TALLOC_CTX *mem_ctx, struct ldb_message *msg 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)); } diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c index 812e0c69b9d..24a467d49fa 100644 --- a/source4/rpc_server/samr/samr_password.c +++ b/source4/rpc_server/samr/samr_password.c @@ -132,7 +132,7 @@ NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, TALLOC_ { 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; @@ -248,7 +248,7 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, { 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; @@ -261,7 +261,7 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, struct samr_Hash *ntPwdHash; struct samr_DomInfo1 *dominfo; struct samr_ChangeReject *reject; - uint32 reason = 0; + uint32_t reason = 0; ZERO_STRUCT(r->out); @@ -424,7 +424,7 @@ NTSTATUS samdb_set_password(void *ctx, TALLOC_CTX *mem_ctx, 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", @@ -677,7 +677,7 @@ NTSTATUS samr_set_password(struct dcesrv_call_state *dce_call, 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); diff --git a/source4/rpc_server/samr/samr_utils.c b/source4/rpc_server/samr/samr_utils.c index 247b2d47f45..6b8a2ff19a6 100644 --- a/source4/rpc_server/samr/samr_utils.c +++ b/source4/rpc_server/samr/samr_utils.c @@ -27,7 +27,7 @@ translated the ACB_CTRL Flags to UserFlags (userAccountControl) */ /* 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 }, @@ -43,9 +43,9 @@ static const struct { { 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;iin.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); } @@ -877,7 +877,7 @@ void reply_read_and_X(struct request_context *req) /* 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); } @@ -1064,10 +1064,10 @@ void reply_write_and_X(struct request_context *req) 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 */ @@ -1754,7 +1754,7 @@ void reply_lockingX(struct request_context *req) /* construct the locks array */ for (i=0;ilockx.in.locks[i].pid = SVAL(p, 0); diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 5c1d14a9d07..068e43cd09f 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -81,7 +81,7 @@ struct request_context *init_smb_request(struct server_context *smb) */ 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; @@ -321,7 +321,7 @@ void req_reply_error(struct request_context *req, NTSTATUS status) 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; @@ -597,7 +597,7 @@ BOOL req_pull_blob(struct request_context *req, const char *src, int len, DATA_B /* 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; diff --git a/source4/smb_server/search.c b/source4/smb_server/search.c index 0a6aaa6c25d..55d1ae7c332 100644 --- a/source4/smb_server/search.c +++ b/source4/smb_server/search.c @@ -69,12 +69,12 @@ static void find_fill_info(struct request_context *req, 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); diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c index 4ea8bdf55ca..46ab1123743 100644 --- a/source4/smb_server/trans2.c +++ b/source4/smb_server/trans2.c @@ -500,7 +500,7 @@ static NTSTATUS trans2_fileinfo_fill(struct request_context *req, struct smb_tra 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); @@ -694,7 +694,7 @@ static NTSTATUS trans2_parse_sfileinfo(struct request_context *req, union smb_setfileinfo *st, const DATA_BLOB *blob) { - uint32 len; + uint32_t len; switch (st->generic.level) { case RAW_SFILEINFO_GENERIC: diff --git a/source4/smbd/build_options.c b/source4/smbd/build_options.c index e450fee4363..dea17df2e07 100644 --- a/source4/smbd/build_options.c +++ b/source4/smbd/build_options.c @@ -526,7 +526,7 @@ void build_options(BOOL screen) 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*)); } diff --git a/source4/smbd/process_thread.c b/source4/smbd/process_thread.c index dcd2f456af5..d37cf8d7ffb 100644 --- a/source4/smbd/process_thread.c +++ b/source4/smbd/process_thread.c @@ -192,16 +192,16 @@ static int thread_mutex_lock(smb_mutex_t *mutexP, const char *name) 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; @@ -254,16 +254,16 @@ static int thread_rwlock_lock_read(smb_rwlock_t *rwlockP, const char *name) 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; @@ -283,16 +283,16 @@ static int thread_rwlock_lock_write(smb_rwlock_t *rwlockP, const char *name) 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; @@ -354,16 +354,16 @@ static void thread_print_suspicious_usage(const char* from, const char* info) #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); } diff --git a/source4/smbd/rewrite.c b/source4/smbd/rewrite.c index 6dc130d2794..38b8ad30158 100644 --- a/source4/smbd/rewrite.c +++ b/source4/smbd/rewrite.c @@ -44,7 +44,7 @@ BOOL share_info_db_init(void) 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) diff --git a/source4/smbd/server.c b/source4/smbd/server.c index f32d6a07021..8a06a5b7df4 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -302,7 +302,7 @@ static void setup_process_model(struct event_context *events, /* 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); } diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c index 1a708ac0554..5febf873bd1 100644 --- a/source4/torture/basic/charset.c +++ b/source4/torture/basic/charset.c @@ -31,8 +31,8 @@ */ 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; @@ -92,8 +92,8 @@ static NTSTATUS unicode_open(struct cli_tree *tree, */ 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"); @@ -121,8 +121,8 @@ static BOOL test_composed(struct cli_state *cli, TALLOC_CTX *mem_ctx) */ 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"); @@ -152,9 +152,9 @@ static BOOL test_diacritical(struct cli_state *cli, TALLOC_CTX *mem_ctx) */ 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"); @@ -191,9 +191,9 @@ static BOOL test_surrogate(struct cli_state *cli, TALLOC_CTX *mem_ctx) */ 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"); diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 5c5bdf5955a..1f33257e6af 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -445,7 +445,7 @@ static const char *gen_pattern(void) /* 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; @@ -455,7 +455,7 @@ static uint32 gen_bits_mask(uint_t 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); @@ -511,7 +511,7 @@ static SMB_OFF_T gen_lock_count(void) /* 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); @@ -520,7 +520,7 @@ static uint32 gen_ntcreatex_flags(void) /* 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; @@ -530,7 +530,7 @@ static uint32 gen_access_mask(void) /* 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; @@ -540,7 +540,7 @@ static uint32 gen_create_options(void) /* 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); @@ -577,7 +577,7 @@ static uint16 gen_openx_func(void) /* 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); @@ -605,7 +605,7 @@ static NTTIME gen_nttime(void) /* 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; diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c index 99393df7df7..e65815fb807 100644 --- a/source4/torture/nbench/nbio.c +++ b/source4/torture/nbench/nbio.c @@ -211,7 +211,7 @@ void nb_createx(const char *fname, NTSTATUS status) { union smb_open io; - uint32 desired_access; + uint32_t desired_access; NTSTATUS ret; TALLOC_CTX *mem_ctx; unsigned flags = 0; diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index 6b85b243d58..88cadf7b66f 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -583,7 +583,7 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) BOOL ret = True; int i; struct { - uint32 open_disp; + uint32_t open_disp; BOOL with_file; NTSTATUS correct_status; } open_funcs[] = { diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c index 14f30db97f2..26c94b6a09b 100644 --- a/source4/torture/raw/qfileinfo.c +++ b/source4/torture/raw/qfileinfo.c @@ -25,7 +25,7 @@ static struct { 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[] = { @@ -159,7 +159,7 @@ BOOL torture_raw_qfileinfo(int dummy) 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; @@ -196,7 +196,7 @@ BOOL torture_raw_qfileinfo(int dummy) /* 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; diff --git a/source4/torture/raw/qfsinfo.c b/source4/torture/raw/qfsinfo.c index 347b34b3e2f..caa47b43f80 100644 --- a/source4/torture/raw/qfsinfo.c +++ b/source4/torture/raw/qfsinfo.c @@ -24,7 +24,7 @@ static struct { const char *name; enum fsinfo_level level; - uint32 capability_mask; + uint32_t capability_mask; NTSTATUS status; union smb_fsinfo fsinfo; } levels[] = { @@ -131,7 +131,7 @@ BOOL torture_raw_qfsinfo(int dummy) /* 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; diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index ae5d8c34a8b..4f4c453bc81 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -70,7 +70,7 @@ static NTSTATUS single_search(struct cli_state *cli, static struct { const char *name; enum search_level level; - uint32 capability_mask; + uint32_t capability_mask; NTSTATUS status; union smb_search_data data; } levels[] = { @@ -123,7 +123,7 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) /* call all the levels */ for (i=0;itransport->negotiate.capabilities; + uint32_t cap = cli->transport->negotiate.capabilities; printf("testing %s\n", levels[i].name); diff --git a/source4/torture/rpc/atsvc.c b/source4/torture/rpc/atsvc.c index bd605d7c4f9..6b1e558902a 100644 --- a/source4/torture/rpc/atsvc.c +++ b/source4/torture/rpc/atsvc.c @@ -21,7 +21,7 @@ #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; @@ -39,8 +39,8 @@ static BOOL test_JobGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32 j 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; @@ -64,7 +64,7 @@ static BOOL test_JobEnum(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) 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"); diff --git a/source4/torture/rpc/dfs.c b/source4/torture/rpc/dfs.c index 940a42a9474..3aa17b6ecce 100644 --- a/source4/torture/rpc/dfs.c +++ b/source4/torture/rpc/dfs.c @@ -26,7 +26,7 @@ static BOOL test_Exist(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { NTSTATUS status; struct dfs_Exist r; - uint32 exist = 0; + uint32_t exist = 0; r.out.exist_flag = ∃ @@ -78,14 +78,14 @@ static BOOL test_EnumLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16 le { 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; diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index cdae51393dc..37e57d0da78 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -33,7 +33,7 @@ static BOOL test_addone(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) 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; diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 85dfdcae317..31b7d1f5b35 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -50,7 +50,7 @@ static BOOL test_GetNumRecords(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struc 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; diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 679e1dbac85..f3e1c04d29f 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -108,7 +108,7 @@ static BOOL test_LookupNames(struct dcerpc_pipe *p, struct lsa_LookupNames r; struct lsa_TransSidArray sids; struct lsa_Name *names; - uint32 count = 0; + uint32_t count = 0; NTSTATUS status; int i; @@ -150,7 +150,7 @@ static BOOL test_LookupSids(struct dcerpc_pipe *p, { 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"); @@ -528,7 +528,7 @@ static BOOL test_EnumAccounts(struct dcerpc_pipe *p, 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"); @@ -588,7 +588,7 @@ static BOOL test_EnumPrivs(struct dcerpc_pipe *p, NTSTATUS status; struct lsa_EnumPrivs r; struct lsa_PrivArray privs1; - uint32 resume_handle = 0; + uint32_t resume_handle = 0; printf("\ntesting EnumPrivs\n"); @@ -615,7 +615,7 @@ static BOOL test_EnumTrustDom(struct dcerpc_pipe *p, { struct lsa_EnumTrustDom r; NTSTATUS status; - uint32 resume_handle = 0; + uint32_t resume_handle = 0; struct lsa_DomainList domains; printf("\nTesting EnumTrustDom\n"); diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c index 2c4863be905..431502fc5c1 100644 --- a/source4/torture/rpc/mgmt.c +++ b/source4/torture/rpc/mgmt.c @@ -205,7 +205,7 @@ BOOL torture_rpc_mgmt(int dummy) 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, diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index bd7a450f586..e3ff679d979 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -48,8 +48,8 @@ static BOOL join_domain_bdc(TALLOC_CTX *mem_ctx) 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; @@ -288,7 +288,7 @@ static BOOL test_SetupCredentials(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } 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; @@ -1092,7 +1092,7 @@ static BOOL test_DatabaseSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) 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; @@ -1102,7 +1102,7 @@ static BOOL test_DatabaseSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) 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;icount; - 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;icount;i++) { lr.in.rids[i] = r.out.sam->entries[i].idx; } @@ -1897,7 +1897,7 @@ static BOOL test_EnumDomainGroups(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_EnumDomainGroups r; - uint32 resume_handle=0; + uint32_t resume_handle=0; int i; BOOL ret = True; @@ -1905,7 +1905,7 @@ static BOOL test_EnumDomainGroups(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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); @@ -1932,7 +1932,7 @@ static BOOL test_EnumDomainAliases(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_EnumDomainAliases r; - uint32 resume_handle=0; + uint32_t resume_handle=0; int i; BOOL ret = True; @@ -1940,7 +1940,7 @@ static BOOL test_EnumDomainAliases(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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); @@ -2058,7 +2058,7 @@ static BOOL test_QueryDisplayInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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)) { @@ -2087,7 +2087,7 @@ static BOOL test_QueryDisplayInfo2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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)) { @@ -2116,7 +2116,7 @@ static BOOL test_QueryDisplayInfo3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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)) { @@ -2240,7 +2240,7 @@ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_EnumDomainGroups q1; struct samr_QueryDisplayInfo q2; NTSTATUS status; - uint32 resume_handle=0; + uint32_t resume_handle=0; int i; BOOL ret = True; @@ -2282,7 +2282,7 @@ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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)) { @@ -2436,7 +2436,7 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 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)) { @@ -2513,7 +2513,7 @@ static BOOL test_CreateDomainGroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_CreateDomainGroup r; - uint32 rid; + uint32_t rid; struct samr_Name name; BOOL ret = True; @@ -2769,13 +2769,13 @@ static BOOL test_EnumDomains(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { 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); diff --git a/source4/torture/rpc/scanner.c b/source4/torture/rpc/scanner.c index 944bb4372d6..be83b6b6c6e 100644 --- a/source4/torture/rpc/scanner.c +++ b/source4/torture/rpc/scanner.c @@ -165,7 +165,7 @@ BOOL torture_rpc_scanner(int dummy) 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, diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index e416c18f90a..6e6d325ab0f 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -31,7 +31,7 @@ static BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, BOOL ret = True; for (i=0;icount = 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;icount = 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;icount = 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;icount = 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;icount = 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;itree)) { uint8 class; - uint32 num; + uint32_t num; /* Check DOS error */ @@ -206,7 +206,7 @@ static BOOL check_error(int line, struct cli_state *c, } -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; @@ -330,7 +330,7 @@ static BOOL rw_torture3(struct cli_state *c, const char *lockfname) 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()); } @@ -1031,10 +1031,10 @@ static BOOL run_locktest3(int dummy) 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; @@ -3342,7 +3342,7 @@ error_test80: } -static uint32 open_attrs_table[] = { +static uint32_t open_attrs_table[] = { FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_READONLY, @@ -3364,9 +3364,9 @@ static uint32 open_attrs_table[] = { 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[] = { @@ -3414,7 +3414,7 @@ static BOOL run_openattrtest(int dummy) 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], diff --git a/source4/utils/net.c b/source4/utils/net.c index 5c78d4d5a71..ce874d2efda 100644 --- a/source4/utils/net.c +++ b/source4/utils/net.c @@ -390,10 +390,10 @@ static int net_getdomainsid(int argc, const char **argv) 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; @@ -405,7 +405,7 @@ static uint32 get_maxrid(void) 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", @@ -429,7 +429,7 @@ static uint32 get_maxrid(void) 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)) { @@ -451,7 +451,7 @@ static uint32 get_maxrid(void) static int net_maxrid(int argc, const char **argv) { - uint32 rid; + uint32_t rid; if (argc != 0) { DEBUG(0, ("usage: net initrid\n")); diff --git a/source4/utils/net_ads_cldap.c b/source4/utils/net_ads_cldap.c index 132238533dd..fd3ded8e82c 100644 --- a/source4/utils/net_ads_cldap.c +++ b/source4/utils/net_ads_cldap.c @@ -25,14 +25,14 @@ #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; @@ -47,7 +47,7 @@ struct cldap_netlogon_reply { struct netlogon_string unk0; - uint32 version; + uint32_t version; uint16 lmnt_token; uint16 lm20_token; }; @@ -160,7 +160,7 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply) ASN1_DATA data; DATA_BLOB blob; DATA_BLOB os1, os2, os3; - uint32 i1; + uint32_t i1; char *p; blob = data_blob(NULL, 8192); diff --git a/source4/utils/net_rap.c b/source4/utils/net_rap.c index 8f3dd53fa6a..3f6543629bc 100644 --- a/source4/utils/net_rap.c +++ b/source4/utils/net_rap.c @@ -57,14 +57,14 @@ int net_rap_file_usage(int argc, const char **argv) 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"\ @@ -150,14 +150,14 @@ int net_rap_share_usage(int argc, const char **argv) 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); @@ -266,8 +266,8 @@ int net_rap_session_usage(int argc, const char **argv) } 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; @@ -279,8 +279,8 @@ static void list_sessions_func(char *wsname, char *username, uint16 conns, 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; @@ -300,7 +300,7 @@ static void display_session_func(const char *wsname, const char *username, } static void display_conns_func(uint16 conn_id, uint16 conn_type, uint16 opens, - uint16 users, uint32 conn_time, + uint16 users, uint32_t conn_time, const char *username, const char *netname) { d_printf("%-14.14s %-8.8s %5d\n", @@ -382,7 +382,7 @@ int net_rap_session(int argc, const char **argv) /**************************************************************************** list a server name ****************************************************************************/ -static void display_server_func(const char *name, uint32 m, +static void display_server_func(const char *name, uint32_t m, const char *comment, void * reserved) { d_printf("\t%-16.16s %s\n", name, comment); diff --git a/source4/utils/net_rpc.c b/source4/utils/net_rpc.c index 89ee34ac018..b4b11b49043 100644 --- a/source4/utils/net_rpc.c +++ b/source4/utils/net_rpc.c @@ -53,7 +53,7 @@ static DOM_SID *net_get_remote_domain_sid(struct cli_state *cli) DOM_SID *domain_sid; POLICY_HND pol; NTSTATUS result = NT_STATUS_OK; - uint32 info_class = 5; + uint32_t info_class = 5; fstring domain_name; TALLOC_CTX *mem_ctx; @@ -489,7 +489,7 @@ static NTSTATUS rpc_user_add_internals(const DOM_SID *domain_sid, struct cli_sta NTSTATUS result = NT_STATUS_UNSUCCESSFUL; const char *acct_name; uint16 acb_info; - uint32 unknown, user_rid; + uint32_t unknown, user_rid; if (argc != 1) { d_printf("User must be specified\n"); @@ -603,8 +603,8 @@ static NTSTATUS rpc_user_del_internals(const DOM_SID *domain_sid, /* Get handle on user */ { - uint32 *user_rids, num_rids, *name_types; - uint32 flags = 0x000003e8; /* Unknown */ + uint32_t *user_rids, num_rids, *name_types; + uint32_t flags = 0x000003e8; /* Unknown */ result = cli_samr_lookup_names(cli, mem_ctx, &domain_pol, flags, 1, &argv[0], @@ -677,8 +677,8 @@ rpc_user_info_internals(const DOM_SID *domain_sid, struct cli_state *cli, { POLICY_HND connect_pol, domain_pol, user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - uint32 *rids, num_rids, *name_types, num_names; - uint32 flags = 0x000003e8; /* Unknown */ + uint32_t *rids, num_rids, *name_types, num_names; + uint32_t flags = 0x000003e8; /* Unknown */ int i; char **names; DOM_GID *user_gids; @@ -719,7 +719,7 @@ rpc_user_info_internals(const DOM_SID *domain_sid, struct cli_state *cli, /* Look up rids */ - rids = (uint32 *)talloc(mem_ctx, sizeof(uint32) * num_rids); + rids = (uint32_t *)talloc(mem_ctx, sizeof(uint32_t) * num_rids); for (i = 0; i < num_rids; i++) rids[i] = user_gids[i].g_rid; @@ -779,7 +779,7 @@ rpc_user_list_internals(const DOM_SID *domain_sid, struct cli_state *cli, { POLICY_HND connect_pol, domain_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - uint32 start_idx=0, num_entries, i, loop_count = 0; + uint32_t start_idx=0, num_entries, i, loop_count = 0; SAM_DISPINFO_CTR ctr; SAM_DISPINFO_1 info1; @@ -809,7 +809,7 @@ rpc_user_list_internals(const DOM_SID *domain_sid, struct cli_state *cli, "\n-----------------------------\n"); do { fstring user, desc; - uint32 max_entries, max_size; + uint32_t max_entries, max_size; get_query_dispinfo_params( loop_count, &max_entries, &max_size); @@ -900,7 +900,7 @@ rpc_group_list_internals(const DOM_SID *domain_sid, struct cli_state *cli, { POLICY_HND connect_pol, domain_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - uint32 start_idx=0, max_entries=250, num_entries, i; + uint32_t start_idx=0, max_entries=250, num_entries, i; struct acct_info *groups; DOM_SID global_sid_Builtin; @@ -1043,8 +1043,8 @@ rpc_share_add_internals(const DOM_SID *domain_sid, struct cli_state *cli, WERROR result; char *sharename=talloc_strdup(mem_ctx, argv[0]); char *path; - uint32 type=0; /* only allow disk shares to be added */ - uint32 num_users=0, perms=0; + uint32_t type=0; /* only allow disk shares to be added */ + uint32_t num_users=0, perms=0; char *password=NULL; /* don't allow a share password */ path = strchr(sharename, '='); @@ -1160,7 +1160,7 @@ rpc_share_list_internals(const DOM_SID *domain_sid, struct cli_state *cli, SRV_SHARE_INFO_CTR ctr; WERROR result; ENUM_HND hnd; - uint32 preferred_len = 0xffffffff, i; + uint32_t preferred_len = 0xffffffff, i; init_enum_hnd(&hnd, 0); @@ -1300,7 +1300,7 @@ rpc_file_list_internals(const DOM_SID *domain_sid, struct cli_state *cli, SRV_FILE_INFO_CTR ctr; WERROR result; ENUM_HND hnd; - uint32 preferred_len = 0xffffffff, i; + uint32_t preferred_len = 0xffffffff, i; const char *username=NULL; init_enum_hnd(&hnd, 0); @@ -1450,7 +1450,7 @@ static NTSTATUS rpc_shutdown_internals(const DOM_SID *domain_sid, struct cli_sta { NTSTATUS result = NT_STATUS_UNSUCCESSFUL; const char *msg = "This machine will be shutdown shortly"; - uint32 timeout = 20; + uint32_t timeout = 20; #if 0 poptContext pc; int rc; @@ -1537,7 +1537,7 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid, struct cli NTSTATUS result = NT_STATUS_UNSUCCESSFUL; char *acct_name; uint16 acb_info; - uint32 unknown, user_rid; + uint32_t unknown, user_rid; if (argc != 1) { d_printf("Usage: net rpc trustdom add \n"); @@ -1885,7 +1885,7 @@ static int rpc_trustdom_list(int argc, const char **argv) /* trusting domains listing variables */ POLICY_HND domain_hnd; char **trusting_dom_names; - uint32 *trusting_dom_rids; + uint32_t *trusting_dom_rids; /* * Listing trusted domains (stored in secrets.tdb, if local) diff --git a/source4/utils/net_rpc_join.c b/source4/utils/net_rpc_join.c index 4f82d0b800b..d790584269e 100644 --- a/source4/utils/net_rpc_join.c +++ b/source4/utils/net_rpc_join.c @@ -47,9 +47,9 @@ int net_rpc_join_ok(const char *domain) struct cli_state *cli; uchar stored_md4_trust_password[16]; int retval = 1; - uint32 channel; + uint32_t channel; NTSTATUS result; - uint32 neg_flags = 0x000001ff; + uint32_t neg_flags = 0x000001ff; /* Connect to remote machine */ if (!(cli = net_make_ipc_connection(NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC))) { @@ -108,13 +108,13 @@ int net_rpc_join_newstyle(int argc, const char **argv) struct cli_state *cli; TALLOC_CTX *mem_ctx; - uint32 acb_info; + uint32_t acb_info; /* rpc variables */ POLICY_HND lsa_pol, sam_pol, domain_pol, user_pol; DOM_SID domain_sid; - uint32 user_rid; + uint32_t user_rid; /* Password stuff */ @@ -131,8 +131,8 @@ int net_rpc_join_newstyle(int argc, const char **argv) NTSTATUS result; int retval = 1; fstring domain; - uint32 num_rids, *name_types, *user_rids; - uint32 flags = 0x3e8; + uint32_t num_rids, *name_types, *user_rids; + uint32_t flags = 0x3e8; char *acct_name; const char *const_acct_name; diff --git a/source4/utils/net_rpc_samsync.c b/source4/utils/net_rpc_samsync.c index 7d5c8681adf..1a733b3ab73 100644 --- a/source4/utils/net_rpc_samsync.c +++ b/source4/utils/net_rpc_samsync.c @@ -26,7 +26,7 @@ extern DOM_SID global_sid_Builtin; -static void display_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *g) +static void display_group_mem_info(uint32_t rid, SAM_GROUP_MEM_INFO *g) { int i; d_printf("Group mem %u: ", rid); @@ -36,13 +36,13 @@ static void display_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *g) d_printf("\n"); } -static void display_alias_info(uint32 rid, SAM_ALIAS_INFO *a) +static void display_alias_info(uint32_t rid, SAM_ALIAS_INFO *a) { d_printf("Alias '%s' ", unistr2_static(&a->uni_als_name)); d_printf("desc='%s' rid=%u\n", unistr2_static(&a->uni_als_desc), a->als_rid); } -static void display_alias_mem(uint32 rid, SAM_ALIAS_MEM_INFO *a) +static void display_alias_mem(uint32_t rid, SAM_ALIAS_MEM_INFO *a) { int i; d_printf("Alias rid %u: ", rid); @@ -52,7 +52,7 @@ static void display_alias_mem(uint32 rid, SAM_ALIAS_MEM_INFO *a) d_printf("\n"); } -static void display_account_info(uint32 rid, SAM_ACCOUNT_INFO *a) +static void display_account_info(uint32_t rid, SAM_ACCOUNT_INFO *a) { fstring hex_nt_passwd, hex_lm_passwd; uchar lm_passwd[16], nt_passwd[16]; @@ -84,7 +84,7 @@ static void display_domain_info(SAM_DOMAIN_INFO *a) d_printf("Domain name: %s\n", unistr2_static(&a->uni_dom_name)); } -static void display_group_info(uint32 rid, SAM_GROUP_INFO *a) +static void display_group_info(uint32_t rid, SAM_GROUP_INFO *a) { d_printf("Group '%s' ", unistr2_static(&a->uni_grp_name)); d_printf("desc='%s', rid=%u\n", unistr2_static(&a->uni_grp_desc), rid); @@ -126,7 +126,7 @@ static void dump_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret TALLOC_CTX *mem_ctx; SAM_DELTA_HDR *hdr_deltas; SAM_DELTA_CTR *deltas; - uint32 num_deltas; + uint32_t num_deltas; if (!(mem_ctx = talloc_init("dump_database"))) { return; @@ -155,7 +155,7 @@ int rpc_samdump(int argc, const char **argv) struct cli_state *cli = NULL; uchar trust_password[16]; DOM_CRED ret_creds; - uint32 neg_flags = 0x000001ff; + uint32_t neg_flags = 0x000001ff; ZERO_STRUCT(ret_creds); @@ -278,7 +278,7 @@ sam_account_from_delta(SAM_ACCOUNT *account, SAM_ACCOUNT_INFO *delta) } static NTSTATUS -fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta) +fetch_account_info(uint32_t rid, SAM_ACCOUNT_INFO *delta) { NTSTATUS nt_ret; fstring account; @@ -357,7 +357,7 @@ fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta) } static NTSTATUS -fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta) +fetch_group_info(uint32_t rid, SAM_GROUP_INFO *delta) { fstring name; fstring comment; @@ -413,7 +413,7 @@ fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta) } static NTSTATUS -fetch_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *delta) +fetch_group_mem_info(uint32_t rid, SAM_GROUP_MEM_INFO *delta) { int i; TALLOC_CTX *t = NULL; @@ -536,7 +536,7 @@ fetch_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *delta) return NT_STATUS_OK; } -static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta, +static NTSTATUS fetch_alias_info(uint32_t rid, SAM_ALIAS_INFO *delta, DOM_SID dom_sid) { fstring name; @@ -597,7 +597,7 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta, } static NTSTATUS -fetch_alias_mem(uint32 rid, SAM_ALIAS_MEM_INFO *delta, DOM_SID dom_sid) +fetch_alias_mem(uint32_t rid, SAM_ALIAS_MEM_INFO *delta, DOM_SID dom_sid) { return NT_STATUS_OK; @@ -644,7 +644,7 @@ fetch_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds, TALLOC_CTX *mem_ctx; SAM_DELTA_HDR *hdr_deltas; SAM_DELTA_CTR *deltas; - uint32 num_deltas; + uint32_t num_deltas; if (!(mem_ctx = talloc_init("fetch_database"))) { return; @@ -675,7 +675,7 @@ int rpc_vampire(int argc, const char **argv) struct cli_state *cli = NULL; uchar trust_password[16]; DOM_CRED ret_creds; - uint32 neg_flags = 0x000001ff; + uint32_t neg_flags = 0x000001ff; DOM_SID dom_sid; ZERO_STRUCT(ret_creds);