mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
added support for 'const' in IDL files. This makes it easy to define
symbolic names for bitfields etc.
(This used to be commit 344a6e1682
)
This commit is contained in:
parent
277322b9d4
commit
e79e6bc472
@ -75,7 +75,7 @@ sub HeaderStruct($$)
|
|||||||
{
|
{
|
||||||
my($struct) = shift;
|
my($struct) = shift;
|
||||||
my($name) = shift;
|
my($name) = shift;
|
||||||
$res .= "struct $name {\n";
|
$res .= "\nstruct $name {\n";
|
||||||
$tab_depth++;
|
$tab_depth++;
|
||||||
if (defined $struct->{ELEMENTS}) {
|
if (defined $struct->{ELEMENTS}) {
|
||||||
foreach my $e (@{$struct->{ELEMENTS}}) {
|
foreach my $e (@{$struct->{ELEMENTS}}) {
|
||||||
@ -143,7 +143,15 @@ sub HeaderTypedef($)
|
|||||||
{
|
{
|
||||||
my($typedef) = shift;
|
my($typedef) = shift;
|
||||||
HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME});
|
HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME});
|
||||||
$res .= ";\n\n";
|
$res .= ";\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
# parse a typedef
|
||||||
|
sub HeaderConst($)
|
||||||
|
{
|
||||||
|
my($const) = shift;
|
||||||
|
$res .= "#define $const->{NAME}\t( $const->{VALUE} )\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
@ -165,7 +173,7 @@ sub HeaderFunctionInOut($$)
|
|||||||
sub HeaderFunction($)
|
sub HeaderFunction($)
|
||||||
{
|
{
|
||||||
my($fn) = shift;
|
my($fn) = shift;
|
||||||
$res .= "struct $fn->{NAME} {\n";
|
$res .= "\nstruct $fn->{NAME} {\n";
|
||||||
$tab_depth++;
|
$tab_depth++;
|
||||||
tabs();
|
tabs();
|
||||||
$res .= "struct {\n";
|
$res .= "struct {\n";
|
||||||
@ -208,7 +216,7 @@ sub HeaderInterface($)
|
|||||||
foreach my $d (@{$data}) {
|
foreach my $d (@{$data}) {
|
||||||
if ($d->{TYPE} eq "FUNCTION") {
|
if ($d->{TYPE} eq "FUNCTION") {
|
||||||
my $u_name = uc $d->{NAME};
|
my $u_name = uc $d->{NAME};
|
||||||
$res .= "#define DCERPC_$u_name $count\n";
|
$res .= "#define DCERPC_$u_name " . sprintf("0x%02x", $count) . "\n";
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,6 +224,8 @@ sub HeaderInterface($)
|
|||||||
$res .= "\n\n";
|
$res .= "\n\n";
|
||||||
|
|
||||||
foreach my $d (@{$data}) {
|
foreach my $d (@{$data}) {
|
||||||
|
($d->{TYPE} eq "CONST") &&
|
||||||
|
HeaderConst($d);
|
||||||
($d->{TYPE} eq "TYPEDEF") &&
|
($d->{TYPE} eq "TYPEDEF") &&
|
||||||
HeaderTypedef($d);
|
HeaderTypedef($d);
|
||||||
($d->{TYPE} eq "FUNCTION") &&
|
($d->{TYPE} eq "FUNCTION") &&
|
||||||
|
@ -28,6 +28,16 @@ interface: 'interface' <commit> identifier '{' definition(s?) '}'
|
|||||||
definition : cpp_prefix
|
definition : cpp_prefix
|
||||||
| typedef { $item[1] }
|
| typedef { $item[1] }
|
||||||
| function { $item[1] }
|
| function { $item[1] }
|
||||||
|
| const { $item[1] }
|
||||||
|
|
||||||
|
const : 'const' <commit> identifier identifier '=' constant ';'
|
||||||
|
{{
|
||||||
|
"TYPE" => "CONST",
|
||||||
|
"DTYPE" => $item[3],
|
||||||
|
"NAME" => $item[4],
|
||||||
|
"VALUE" => $item{constant}
|
||||||
|
}}
|
||||||
|
| <error?>
|
||||||
|
|
||||||
typedef : 'typedef' <commit> type identifier array_len(?) ';'
|
typedef : 'typedef' <commit> type identifier array_len(?) ';'
|
||||||
{{
|
{{
|
||||||
@ -165,7 +175,7 @@ anytext: text2 '(' <commit> anytext ')' anytext
|
|||||||
call: expression '(' <commit> expression ')'
|
call: expression '(' <commit> expression ')'
|
||||||
{{ "$item[1]($item[4])" }}
|
{{ "$item[1]($item[4])" }}
|
||||||
|
|
||||||
constant: /-?\d+/
|
constant: /-?[\dx]+/
|
||||||
| '*'
|
| '*'
|
||||||
|
|
||||||
cpp_prefix: '#' /.*/
|
cpp_prefix: '#' /.*/
|
||||||
|
@ -732,16 +732,16 @@
|
|||||||
/************************/
|
/************************/
|
||||||
/* Function 0x2c */
|
/* Function 0x2c */
|
||||||
|
|
||||||
/*
|
/* password properties flags */
|
||||||
const ULONG DOMAIN_PASSWORD_COMPLEX = 0x00000001;
|
const uint32 DOMAIN_PASSWORD_COMPLEX = 0x00000001;
|
||||||
const ULONG DOMAIN_PASSWORD_NO_ANON_CHANGE = 0x00000002;
|
const uint32 DOMAIN_PASSWORD_NO_ANON_CHANGE = 0x00000002;
|
||||||
const ULONG DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004;
|
const uint32 DOMAIN_PASSWORD_NO_CLEAR_CHANGE = 0x00000004;
|
||||||
const ULONG DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010;
|
const uint32 DOMAIN_PASSWORD_STORE_CLEARTEXT = 0x00000010;
|
||||||
const ULONG DOMAIN_REFUSE_PASSWORD_CHANGE = 0x00000020;
|
const uint32 DOMAIN_REFUSE_PASSWORD_CHANGE = 0x00000020;
|
||||||
*/
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16 min_pwd_len;
|
uint16 min_pwd_len;
|
||||||
uint32 passwd_properties;
|
uint32 password_properties;
|
||||||
} samr_PwInfo;
|
} samr_PwInfo;
|
||||||
|
|
||||||
NTSTATUS samr_GetUserPwInfo(
|
NTSTATUS samr_GetUserPwInfo(
|
||||||
|
Loading…
Reference in New Issue
Block a user