summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-27 06:16:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:15 -0500
commit3dd17f128831e09c230a8d56e34495d3b31dbacb (patch)
tree962c0357cf7e14bf2c7950461185d0a9d35b1c96
parent00169404eddd859262ef6f0684143efbedcd7bf7 (diff)
downloadsamba-3dd17f128831e09c230a8d56e34495d3b31dbacb.tar.gz
samba-3dd17f128831e09c230a8d56e34495d3b31dbacb.tar.bz2
samba-3dd17f128831e09c230a8d56e34495d3b31dbacb.zip
r5034: - added a type mapping function in pidl, so the type names in our IDL
files don't need to match the type names in the generated headers - with this type mapping we no longer need definitions for the deprecated "int32", "uint8" etc form of types. We can now force everyone to use the standard types int32_t, uint8_t etc. - fixed all the code that used the deprecated types - converted the IDL types "int64" and "uint64" to "dlong" and "udlong". These are the 4 byte aligned 64 bit integers that Microsoft internally define as two 32 bit integers in a structure. After discussions with Ronnie Sahlberg we decided that calling these "int64" was confusing, as it implied a true 8 byte aligned type - fixed all the cases where we incorrectly used things like "NTTIME_hyper" in our C code. The generated API now uses a NTTIME for those. The fact that it is hyper-aligned on the wire is not relevant to the API, and should remain just a IDL property (This used to be commit f86521677d7ff16bdc4815f9524e5286026f10f3)
-rw-r--r--source4/build/pidl/eparser.pm4
-rw-r--r--source4/build/pidl/header.pm4
-rw-r--r--source4/build/pidl/parser.pm2
-rw-r--r--source4/build/pidl/util.pm45
-rw-r--r--source4/include/includes.h43
-rw-r--r--source4/include/smb.h9
-rw-r--r--source4/lib/dcom/common/dcom.h4
-rw-r--r--source4/lib/dcom/common/main.c8
-rw-r--r--source4/libcli/ldap/ldap.h12
-rw-r--r--source4/librpc/idl/netlogon.idl16
-rw-r--r--source4/librpc/idl/samr.idl6
-rw-r--r--source4/librpc/idl/xattr.idl12
-rw-r--r--source4/librpc/ndr/libndr.h21
-rw-r--r--source4/librpc/ndr/ndr_basic.c52
-rw-r--r--source4/rpc_server/dcom/oxidresolver.c2
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c4
-rw-r--r--source4/torture/rpc/drsuapi.c6
-rw-r--r--source4/torture/rpc/oxidresolve.c14
18 files changed, 111 insertions, 153 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index f6403992ad..1893a31573 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -445,10 +445,6 @@ sub RewriteHeader($$$)
s/^\#include\ \"librpc\/gen_ndr\/ndr_(.*?).h\"$
/\#include \"packet-dcerpc-$1.h\"/smgx;
- # Convert samba fixed width types to stdint types
-
- s/((u)?int)([0-9]+)/$1$3_t/smg;
-
# Rename struct ndr_pull to struct pidl_pull
s/struct ndr_pull \*ndr/struct pidl_pull \*ndr/smg;
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index 51983460ed..c1fb5e6619 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -191,7 +191,7 @@ sub HeaderType($$$)
my $bitmap = util::get_bitmap($e->{TYPE});
$res .= util::bitmap_type_decl($bitmap);
} elsif (util::is_scalar_type($data)) {
- $res .= "$data";
+ $res .= util::map_type($data);
} elsif (util::has_property($e, "switch_is")) {
$res .= "union $data";
} else {
@@ -349,7 +349,7 @@ sub HeaderFunction($)
HeaderFunctionInOut($fn, "out");
if ($fn->{RETURN_TYPE} && $fn->{RETURN_TYPE} ne "void") {
tabs();
- $res .= "$fn->{RETURN_TYPE} result;\n";
+ $res .= util::map_type($fn->{RETURN_TYPE}) . " result;\n";
}
$tab_depth--;
tabs();
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 1368099403..ac29fe0285 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -470,7 +470,7 @@ sub ParseElementPullSwitch($$$$)
if (!defined $utype ||
!util::has_property($utype, "nodiscriminant")) {
my $e2 = find_sibling($e, $switch);
- my $type_decl = $e2->{TYPE};
+ my $type_decl = util::map_type($e2->{TYPE});
pidl "\tif (($ndr_flags) & NDR_SCALARS) {\n";
if (util::is_enum($e2->{TYPE})) {
$type_decl = util::enum_type_decl($e2);
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm
index 48fd9469b8..277c6c0253 100644
--- a/source4/build/pidl/util.pm
+++ b/source4/build/pidl/util.pm
@@ -259,7 +259,7 @@ sub get_bitmap($)
return $bitmap_list{$name};
}
-sub bitmap_type_decl($)
+sub bitmap_type_fn($)
{
my $bitmap = shift;
@@ -273,12 +273,13 @@ sub bitmap_type_decl($)
return "uint32";
}
-sub bitmap_type_fn($)
+sub bitmap_type_decl($)
{
my $bitmap = shift;
- return bitmap_type_decl($bitmap);
+ return map_type(bitmap_type_fn($bitmap));
}
+
my %type_alignments =
(
"char" => 1,
@@ -291,8 +292,8 @@ my %type_alignments =
"long" => 4,
"int32" => 4,
"uint32" => 4,
- "int64" => 4,
- "uint64" => 4,
+ "dlong" => 4,
+ "udlong" => 4,
"NTTIME" => 4,
"NTTIME_1sec" => 4,
"time_t" => 4,
@@ -301,6 +302,7 @@ my %type_alignments =
"WERROR" => 4,
"boolean32" => 4,
"unsigned32" => 4,
+ "hyper" => 8,
"HYPER_T" => 8,
"NTTIME_hyper" => 8
);
@@ -519,5 +521,38 @@ sub make_str($)
return "\"" . $str . "\"";
}
+
+# provide mappings between IDL base types and types in our headers
+my %type_mappings =
+ (
+ "int8" => "int8_t",
+ "uint8" => "uint8_t",
+ "short" => "int16_t",
+ "wchar_t" => "uint16_t",
+ "int16" => "int16_t",
+ "uint16" => "uint16_t",
+ "int32" => "int32_t",
+ "uint32" => "uint32_t",
+ "int64" => "int64_t",
+ "uint64" => "uint64_t",
+ "dlong" => "int64_t",
+ "udlong" => "uint64_t",
+ "hyper" => "uint64_t",
+ "HYPER_T" => "uint64_t",
+ "hyper" => "uint64_t",
+ "NTTIME_1sec" => "NTTIME",
+ "NTTIME_hyper" => "NTTIME"
+ );
+
+# map from a IDL type to a C header type
+sub map_type($)
+{
+ my $name = shift;
+ if (my $ret = $type_mappings{$name}) {
+ return $ret;
+ }
+ return $name;
+}
+
1;
diff --git a/source4/include/includes.h b/source4/include/includes.h
index 8c2e96b62e..68e369a77b 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -85,49 +85,6 @@
#define VOLATILE
#endif
-/*
- Samba needs type definitions for
- int8_t, int16_t, int32_t, int64_t
- uint8_t, uint16_t, uint32_t and uint64_t.
-
- Normally these are signed and unsigned 8, 16, 32 and 64 bit integers, but
- they actually only need to be at least 8, 16, 32 and 64 bits
- respectively. Thus if your word size is 8 bytes just defining them
- as signed and unsigned int will work.
-*/
-
-#if !defined(int8)
-#define int8 int8_t
-#endif
-
-#if !defined(uint8)
-#define uint8 uint8_t
-#endif
-
-#if !defined(int16)
-#define int16 int16_t
-#endif
-
-#if !defined(uint16)
-#define uint16 uint16_t
-#endif
-
-#if !defined(int32)
-#define int32 int32_t
-#endif
-
-#if !defined(uint32)
-#define uint32 uint32_t
-#endif
-
-#if !defined(int64)
-#define int64 int64_t
-#endif
-
-#if !defined(uint64)
-#define uint64 uint64_t
-#endif
-
#define False (0)
#define True (1)
#define Auto (2)
diff --git a/source4/include/smb.h b/source4/include/smb.h
index 3032847460..e40f86eb4c 100644
--- a/source4/include/smb.h
+++ b/source4/include/smb.h
@@ -196,18 +196,9 @@ typedef struct data_blob {
size_t length;
} DATA_BLOB;
-/* 8 byte aligned 'hyper' type from MS IDL */
-typedef uint64_t HYPER_T;
-
/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30, 4 byte aligned */
typedef uint64_t NTTIME;
-/* 64 bit time (100 nanosec) 1601, but 8 byte aligned 'hyper' type */
-#define NTTIME_hyper NTTIME
-
-/* 64 bit time (1 sec) 1601 - in the NDR blob but mapped to NTTIME */
-#define NTTIME_1sec NTTIME
-
/* the basic packet size, assuming no words or bytes. Does not include the NBT header */
#define MIN_SMB_SIZE 35
diff --git a/source4/lib/dcom/common/dcom.h b/source4/lib/dcom/common/dcom.h
index d8e3797c73..0bc4a256f1 100644
--- a/source4/lib/dcom/common/dcom.h
+++ b/source4/lib/dcom/common/dcom.h
@@ -34,12 +34,12 @@ struct dcom_context
struct dcom_object_exporter *prev, *next;
struct STRINGARRAY resolver_address;
struct DUALSTRINGARRAY bindings;
- HYPER_T oxid;
+ uint64_t oxid;
struct dcerpc_pipe *pipe;
struct dcom_object
{
struct dcom_object *prev, *next;
- HYPER_T oid;
+ uint64_t oid;
void *private_data;
} *objects;
} *oxids;
diff --git a/source4/lib/dcom/common/main.c b/source4/lib/dcom/common/main.c
index 48b5ec946b..219c06a665 100644
--- a/source4/lib/dcom/common/main.c
+++ b/source4/lib/dcom/common/main.c
@@ -116,7 +116,7 @@ WERROR dcom_init(struct dcom_context **ctx, const char *domain, const char *user
return WERR_OK;
}
-static struct dcom_object_exporter *oxid_mapping_by_oxid (struct dcom_context *ctx, HYPER_T oxid)
+static struct dcom_object_exporter *oxid_mapping_by_oxid (struct dcom_context *ctx, uint64_t oxid)
{
struct dcom_object_exporter *m;
@@ -345,7 +345,7 @@ NTSTATUS dcom_get_pipe (struct dcom_interface_p *iface, struct dcerpc_pipe **pp)
{
struct dcerpc_binding binding;
struct GUID iid;
- HYPER_T oxid;
+ uint64_t oxid;
NTSTATUS status;
int i;
struct dcerpc_pipe *p;
@@ -408,7 +408,7 @@ NTSTATUS dcom_get_pipe (struct dcom_interface_p *iface, struct dcerpc_pipe **pp)
return NT_STATUS_OK;
}
-struct dcom_object *dcom_object_by_oid(struct dcom_object_exporter *ox, HYPER_T oid)
+struct dcom_object *dcom_object_by_oid(struct dcom_object_exporter *ox, uint64_t oid)
{
struct dcom_object *o;
@@ -544,7 +544,7 @@ NTSTATUS dcom_ifacep_from_OBJREF(struct dcom_context *ctx, struct dcom_interface
return NT_STATUS_NOT_SUPPORTED;
}
-HYPER_T dcom_get_current_oxid(void)
+uint64_t dcom_get_current_oxid(void)
{
return getpid();
}
diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h
index 65962bf5b5..8947562b77 100644
--- a/source4/libcli/ldap/ldap.h
+++ b/source4/libcli/ldap/ldap.h
@@ -146,8 +146,8 @@ struct ldap_SearchRequest {
const char *basedn;
enum ldap_scope scope;
enum ldap_deref deref;
- uint32 timelimit;
- uint32 sizelimit;
+ uint32_t timelimit;
+ uint32_t sizelimit;
BOOL attributesonly;
char *filter;
int num_attributes;
@@ -206,7 +206,7 @@ struct ldap_CompareRequest {
};
struct ldap_AbandonRequest {
- uint32 messageid;
+ uint32_t messageid;
};
struct ldap_ExtendedRequest {
@@ -251,8 +251,8 @@ struct ldap_Control {
struct ldap_message {
TALLOC_CTX *mem_ctx;
- uint32 messageid;
- uint8 type;
+ uint32_t messageid;
+ uint8_t type;
union ldap_Request r;
int num_controls;
struct ldap_Control *controls;
@@ -269,7 +269,7 @@ struct ldap_connection {
int sock;
int next_msgid;
char *host;
- uint16 port;
+ uint16_t port;
BOOL ldaps;
const char *auth_dn;
diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl
index 3d3005685b..cb537d75a3 100644
--- a/source4/librpc/idl/netlogon.idl
+++ b/source4/librpc/idl/netlogon.idl
@@ -76,8 +76,8 @@ interface netlogon
/* in netr_AcctLockStr size seems to be be 24, and rrenard thinks
that the structure of the bindata looks like this:
- uint64 lockout_duration;
- uint64 reset_count;
+ dlong lockout_duration;
+ udlong reset_count;
uint32 bad_attempt_lockout;
uint32 dummy;
@@ -407,9 +407,9 @@ interface netlogon
uint16 min_password_length;
uint16 password_history_length;
/* yes, these are signed. They are in negative 100ns */
- int64 max_password_age;
- int64 min_password_age;
- uint64 sequence_num;
+ dlong max_password_age;
+ dlong min_password_age;
+ udlong sequence_num;
NTTIME domain_create_time;
uint32 SecurityInformation;
sec_desc_buf sdbuf;
@@ -504,7 +504,7 @@ interface netlogon
netr_String primary_domain_name;
dom_sid2 *sid;
netr_QUOTA_LIMITS quota_limits;
- uint64 sequence_num;
+ udlong sequence_num;
NTTIME db_create_time;
uint32 SecurityInformation;
sec_desc_buf sdbuf;
@@ -635,7 +635,7 @@ interface netlogon
[case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret;
[case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group;
[case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user;
- [case(NETR_DELTA_MODIFY_COUNT)] uint64 *modified_count;
+ [case(NETR_DELTA_MODIFY_COUNT)] udlong *modified_count;
} netr_DELTA_UNION;
typedef union {
@@ -681,7 +681,7 @@ interface netlogon
[in] netr_Authenticator credential,
[in,out] netr_Authenticator return_authenticator,
[in] netr_SamDatabaseID database_id,
- [in,out] uint64 sequence_num,
+ [in,out] udlong sequence_num,
[in] uint32 preferredmaximumlength,
[out] netr_DELTA_ENUM_ARRAY *delta_enum_array
);
diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl
index fd6229bf63..db7f4aa6cc 100644
--- a/source4/librpc/idl/samr.idl
+++ b/source4/librpc/idl/samr.idl
@@ -135,8 +135,8 @@
uint16 password_history_length;
uint32 password_properties;
/* yes, these are signed. They are in negative 100ns */
- int64 max_password_age;
- int64 min_password_age;
+ dlong max_password_age;
+ dlong min_password_age;
} samr_DomInfo1;
typedef struct {
@@ -144,7 +144,7 @@
samr_String comment;
samr_String domain; /* domain name */
samr_String primary; /* PDC name if this is a BDC */
- uint64 sequence_num;
+ udlong sequence_num;
uint32 unknown2;
samr_Role role;
uint32 unknown3;
diff --git a/source4/librpc/idl/xattr.idl b/source4/librpc/idl/xattr.idl
index 501ac2ab7d..afcefe49bc 100644
--- a/source4/librpc/idl/xattr.idl
+++ b/source4/librpc/idl/xattr.idl
@@ -23,8 +23,8 @@ interface xattr
typedef struct {
uint32 attrib;
uint32 ea_size;
- uint64 size;
- uint64 alloc_size;
+ udlong size;
+ udlong alloc_size;
NTTIME create_time;
NTTIME change_time;
} xattr_DosInfo1;
@@ -35,8 +35,8 @@ interface xattr
uint32 flags;
uint32 attrib;
uint32 ea_size;
- uint64 size;
- uint64 alloc_size;
+ udlong size;
+ udlong alloc_size;
NTTIME create_time;
NTTIME change_time;
NTTIME write_time; /* only used when sticky write time is set */
@@ -82,8 +82,8 @@ interface xattr
typedef struct {
uint32 flags;
- uint64 size;
- uint64 alloc_size;
+ udlong size;
+ udlong alloc_size;
utf8string name;
} xattr_DosStream;
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index b5a5573448..7070ae80ec 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -199,27 +199,6 @@ enum ndr_err_code {
} \
} while(0)
-#define NDR_SIZE_ALIGN(t, n, flags) ((flags & LIBNDR_FLAG_NOALIGN)?(t):(((t) + (n-1)) & ~(n-1)))
-#define ndr_size_uint8(t, p, flags) (NDR_SIZE_ALIGN(t, 1, flags) + 1)
-#define ndr_size_uint16(t, p, flags) (NDR_SIZE_ALIGN(t, 2, flags) + 2)
-#define ndr_size_int32(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4)
-#define ndr_size_uint32(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4)
-#define ndr_size_ptr(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4)
-/*
- * [u]int64 uses 4 Byte alignment
- * and HYPER_T uses 8 Byte alignment
- */
-#define ndr_size_int64(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 8)
-#define ndr_size_uint64(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 8)
-#define ndr_size_HYPER_T(t, p, flags) (NDR_SIZE_ALIGN(t, 8, flags) + 8)
-
-
-#define ndr_size_NTTIME(t, p, flags) ndr_size_uint64(t, p, flags)
-#define ndr_size_NTTIME_1sec(t, p, flags) ndr_size_HYPER_T(t, p, flags)
-
-#define ndr_size_WERROR(t, p, flags) ndr_size_uint32(t, p, flags)
-#define ndr_size_NTSTATUS(t, p, flags) ndr_size_uint32(t, p, flags)
-
/* these are used to make the error checking on each element in libndr
less tedious, hopefully making the code more readable */
#define NDR_CHECK(call) do { NTSTATUS _status; \
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 6476f58764..7ca930d78d 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -118,9 +118,9 @@ NTSTATUS ndr_pull_ptr(struct ndr_pull *ndr, uint32_t *v)
}
/*
- parse a uint64
+ parse a udlong
*/
-NTSTATUS ndr_pull_uint64(struct ndr_pull *ndr, uint64_t *v)
+NTSTATUS ndr_pull_udlong(struct ndr_pull *ndr, uint64_t *v)
{
NDR_PULL_ALIGN(ndr, 4);
NDR_PULL_NEED_BYTES(ndr, 8);
@@ -131,20 +131,20 @@ NTSTATUS ndr_pull_uint64(struct ndr_pull *ndr, uint64_t *v)
}
/*
- parse a int64
+ parse a dlong
*/
-NTSTATUS ndr_pull_int64(struct ndr_pull *ndr, int64_t *v)
+NTSTATUS ndr_pull_dlong(struct ndr_pull *ndr, int64_t *v)
{
- return ndr_pull_uint64(ndr, (uint64_t *)v);
+ return ndr_pull_udlong(ndr, (uint64_t *)v);
}
/*
- parse a HYPER_T
+ parse a hyper
*/
-NTSTATUS ndr_pull_HYPER_T(struct ndr_pull *ndr, HYPER_T *v)
+NTSTATUS ndr_pull_HYPER_T(struct ndr_pull *ndr, uint64_t *v)
{
NDR_PULL_ALIGN(ndr, 8);
- return ndr_pull_uint64(ndr, v);
+ return ndr_pull_udlong(ndr, v);
}
/*
@@ -251,7 +251,7 @@ NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *da
/*
pull a const array of HYPER_T
*/
-NTSTATUS ndr_pull_array_HYPER_T(struct ndr_pull *ndr, int ndr_flags, HYPER_T *data, uint32_t n)
+NTSTATUS ndr_pull_array_HYPER_T(struct ndr_pull *ndr, int ndr_flags, uint64_t *data, uint32_t n)
{
uint32_t i;
if (!(ndr_flags & NDR_SCALARS)) {
@@ -330,7 +330,7 @@ NTSTATUS ndr_push_int32(struct ndr_push *ndr, int32_t v)
/*
push a uint64
*/
-NTSTATUS ndr_push_uint64(struct ndr_push *ndr, uint64_t v)
+NTSTATUS ndr_push_udlong(struct ndr_push *ndr, uint64_t v)
{
NDR_PUSH_ALIGN(ndr, 4);
NDR_PUSH_NEED_BYTES(ndr, 8);
@@ -343,18 +343,18 @@ NTSTATUS ndr_push_uint64(struct ndr_push *ndr, uint64_t v)
/*
push a int64
*/
-NTSTATUS ndr_push_int64(struct ndr_push *ndr, int64_t v)
+NTSTATUS ndr_push_dlong(struct ndr_push *ndr, int64_t v)
{
- return ndr_push_uint64(ndr, (uint64_t)v);
+ return ndr_push_udlong(ndr, (uint64_t)v);
}
/*
push a HYPER_T
*/
-NTSTATUS ndr_push_HYPER_T(struct ndr_push *ndr, HYPER_T v)
+NTSTATUS ndr_push_HYPER_T(struct ndr_push *ndr, uint64_t v)
{
NDR_PUSH_ALIGN(ndr, 8);
- return ndr_push_uint64(ndr, v);
+ return ndr_push_udlong(ndr, v);
}
NTSTATUS ndr_push_align(struct ndr_push *ndr, size_t size)
@@ -435,7 +435,7 @@ NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, int ndr_flags, const uint32
/*
push an array of HYPER_T
*/
-NTSTATUS ndr_push_array_HYPER_T(struct ndr_push *ndr, int ndr_flags, const HYPER_T *data, uint32_t n)
+NTSTATUS ndr_push_array_HYPER_T(struct ndr_push *ndr, int ndr_flags, const uint64_t *data, uint32_t n)
{
int i;
if (!(ndr_flags & NDR_SCALARS)) {
@@ -946,7 +946,7 @@ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s)
*/
NTSTATUS ndr_push_NTTIME(struct ndr_push *ndr, NTTIME t)
{
- NDR_CHECK(ndr_push_uint64(ndr, t));
+ NDR_CHECK(ndr_push_udlong(ndr, t));
return NT_STATUS_OK;
}
@@ -955,7 +955,7 @@ NTSTATUS ndr_push_NTTIME(struct ndr_push *ndr, NTTIME t)
*/
NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, NTTIME *t)
{
- NDR_CHECK(ndr_pull_uint64(ndr, t));
+ NDR_CHECK(ndr_pull_udlong(ndr, t));
return NT_STATUS_OK;
}
@@ -982,7 +982,7 @@ NTSTATUS ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, NTTIME *t)
/*
pull a NTTIME_hyper
*/
-NTSTATUS ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, NTTIME_hyper *t)
+NTSTATUS ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, NTTIME *t)
{
NDR_CHECK(ndr_pull_HYPER_T(ndr, t));
return NT_STATUS_OK;
@@ -991,7 +991,7 @@ NTSTATUS ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, NTTIME_hyper *t)
/*
push a NTTIME_hyper
*/
-NTSTATUS ndr_push_NTTIME_hyper(struct ndr_push *ndr, NTTIME_hyper t)
+NTSTATUS ndr_push_NTTIME_hyper(struct ndr_push *ndr, NTTIME t)
{
NDR_CHECK(ndr_push_HYPER_T(ndr, t));
return NT_STATUS_OK;
@@ -1068,7 +1068,7 @@ void ndr_print_int32(struct ndr_print *ndr, const char *name, int32_t v)
ndr->print(ndr, "%-25s: %d", name, v);
}
-void ndr_print_uint64(struct ndr_print *ndr, const char *name, uint64_t v)
+void ndr_print_udlong(struct ndr_print *ndr, const char *name, uint64_t v)
{
ndr->print(ndr, "%-25s: 0x%08x%08x (%llu)", name,
(uint32_t)(v >> 32),
@@ -1076,7 +1076,7 @@ void ndr_print_uint64(struct ndr_print *ndr, const char *name, uint64_t v)
v);
}
-void ndr_print_int64(struct ndr_print *ndr, const char *name, int64_t v)
+void ndr_print_dlong(struct ndr_print *ndr, const char *name, int64_t v)
{
ndr->print(ndr, "%-25s: 0x%08x%08x (%lld)", name,
(uint32_t)(v >> 32),
@@ -1084,9 +1084,9 @@ void ndr_print_int64(struct ndr_print *ndr, const char *name, int64_t v)
v);
}
-void ndr_print_HYPER_T(struct ndr_print *ndr, const char *name, HYPER_T v)
+void ndr_print_HYPER_T(struct ndr_print *ndr, const char *name, uint64_t v)
{
- ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32_t)(v >> 32), (uint32_t)(v & 0xFFFFFFFF));
+ ndr_print_dlong(ndr, name, v);
}
void ndr_print_ptr(struct ndr_print *ndr, const char *name, const void *p)
@@ -1112,7 +1112,7 @@ void ndr_print_NTTIME(struct ndr_print *ndr, const char *name, NTTIME t)
ndr->print(ndr, "%-25s: %s", name, nt_time_string(ndr, t));
}
-void ndr_print_NTTIME_1sec(struct ndr_print *ndr, const char *name, NTTIME_1sec t)
+void ndr_print_NTTIME_1sec(struct ndr_print *ndr, const char *name, NTTIME t)
{
/* this is a standard NTTIME here
* as it's already converted in the pull/push code
@@ -1120,7 +1120,7 @@ void ndr_print_NTTIME_1sec(struct ndr_print *ndr, const char *name, NTTIME_1sec
ndr_print_NTTIME(ndr, name, t);
}
-void ndr_print_NTTIME_hyper(struct ndr_print *ndr, const char *name, NTTIME_hyper t)
+void ndr_print_NTTIME_hyper(struct ndr_print *ndr, const char *name, NTTIME t)
{
ndr_print_NTTIME(ndr, name, t);
}
@@ -1163,7 +1163,7 @@ void ndr_print_array_WERROR(struct ndr_print *ndr, const char *name,
}
void ndr_print_array_HYPER_T(struct ndr_print *ndr, const char *name,
- const HYPER_T *data, uint32_t count)
+ const uint64_t *data, uint32_t count)
{
int i;
diff --git a/source4/rpc_server/dcom/oxidresolver.c b/source4/rpc_server/dcom/oxidresolver.c
index a3f65b62e5..1880d6f8dc 100644
--- a/source4/rpc_server/dcom/oxidresolver.c
+++ b/source4/rpc_server/dcom/oxidresolver.c
@@ -31,7 +31,7 @@ struct OXIDObject
struct PingSet
{
- HYPER_T id;
+ uint64_t id;
struct OXIDObject *objects;
struct PingSet *prev, *next;
};
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 2bef02be11..ff33d52d01 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -2160,7 +2160,7 @@ static NTSTATUS lsa_QuerySecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *
}
if (r->in.old_mtime) {
- r->out.old_mtime = talloc(mem_ctx, NTTIME_hyper);
+ r->out.old_mtime = talloc(mem_ctx, NTTIME);
if (!r->out.old_mtime) {
return NT_STATUS_NO_MEMORY;
}
@@ -2196,7 +2196,7 @@ static NTSTATUS lsa_QuerySecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *
}
if (r->in.new_mtime) {
- r->out.new_mtime = talloc(mem_ctx, NTTIME_hyper);
+ r->out.new_mtime = talloc(mem_ctx, NTTIME);
if (!r->out.new_mtime) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index 2e3fe87bb4..4821d67d9c 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -638,8 +638,8 @@ static BOOL test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
BOOL ret = True;
int i;
struct {
- int32 level;
- int32 infotype;
+ int32_t level;
+ int32_t infotype;
const char *obj_dn;
} array[] = {
{
@@ -765,7 +765,7 @@ static BOOL test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct drsuapi_DsReplicaSyncRequest1Info info1;
struct {
- int32 level;
+ int32_t level;
} array[] = {
{
1
diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index cbd287b453..1849302929 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -28,7 +28,7 @@
#define CLSID_SIMPLE "5e9ddec7-5767-11cf-beab-00aa006c3606"
#define CLSID_COFFEEMACHINE "DB7C21F8-FE33-4C11-AEA5-CEB56F076FBB"
-static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T *oxid, struct GUID *oid)
+static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t *oxid, struct GUID *oid)
{
struct RemoteActivation r;
NTSTATUS status;
@@ -74,7 +74,7 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYP
return 1;
}
-static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T setid)
+static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t setid)
{
struct SimplePing r;
NTSTATUS status;
@@ -95,7 +95,7 @@ static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T s
return 1;
}
-static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T *setid, struct GUID oid)
+static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t *setid, struct GUID oid)
{
struct ComplexPing r;
NTSTATUS status;
@@ -143,7 +143,7 @@ static int test_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return 1;
}
-static int test_ResolveOxid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T oxid)
+static int test_ResolveOxid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t oxid)
{
struct ResolveOxid r;
NTSTATUS status;
@@ -167,7 +167,7 @@ static int test_ResolveOxid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T
return 1;
}
-static int test_ResolveOxid2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T oxid)
+static int test_ResolveOxid2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t oxid)
{
struct ResolveOxid2 r;
NTSTATUS status;
@@ -220,8 +220,8 @@ BOOL torture_rpc_oxidresolve(void)
struct dcerpc_pipe *p, *premact;
TALLOC_CTX *mem_ctx;
BOOL ret = True;
- HYPER_T setid;
- HYPER_T oxid;
+ uint64_t setid;
+ uint64_t oxid;
struct GUID oid;
mem_ctx = talloc_init("torture_rpc_oxidresolve");