ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
411 discussions
Start a n
N
ew thread
[frik85] 13726: Change icons: speaker
by frik85@svn.reactos.com
Change icons: speaker Modified: trunk/reactos/subsys/system/sndvol32/resources/sndvol32.ico _____ Modified: trunk/reactos/subsys/system/sndvol32/resources/sndvol32.ico (Binary files differ)
19 years, 10 months
1
0
0
0
[ekohl] 13725: WIDL: Support basic type function arguments.
by ekohl@svn.reactos.com
WIDL: Support basic type function arguments. Modified: trunk/reactos/tools/widl/client.c Modified: trunk/reactos/tools/widl/server.c _____ Modified: trunk/reactos/tools/widl/client.c --- trunk/reactos/tools/widl/client.c 2005-02-23 10:37:46 UTC (rev 13724) +++ trunk/reactos/tools/widl/client.c 2005-02-23 13:15:40 UTC (rev 13725) @@ -58,7 +58,8 @@ static void write_procformatstring(type_t *iface) { - func_t *cur = iface->funcs; + func_t *func = iface->funcs; + var_t *var; print_client("static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =\n"); print_client("{\n"); @@ -67,23 +68,107 @@ print_client("{\n"); indent++; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { - var_t *def = cur->def; + /* emit argument data */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + switch(var->type->type) + { + case RPC_FC_BYTE: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_BYTE */\n", var->type->type); + break; + case RPC_FC_CHAR: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_CHAR */\n", var->type->type); + break; + case RPC_FC_WCHAR: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_WCHAR */\n", var->type->type); + break; + case RPC_FC_USHORT: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_USHORT */\n", var->type->type); + break; + case RPC_FC_SHORT: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_SHORT */\n", var->type->type); + break; + case RPC_FC_ULONG: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_ULONG */\n", var->type->type); + break; + case RPC_FC_LONG: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_LONG */\n", var->type->type); + break; + case RPC_FC_HYPER: + print_client("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_HYPER */\n", var->type->type); + break; + default: + error("Unknown/unsupported type\n"); + } - if (is_void(def->type, NULL)) + var = PREV_LINK(var); + } + } + + /* emit return value data */ + var = func->def; + if (is_void(var->type, NULL)) { print_client("0x5b, /* FC_END */\n"); print_client("0x5c, /* FC_PAD */\n"); } else { - print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); - print_client("0x%02x, /* <type> */\n", def->type->type); + switch(var->type->type) + { + case RPC_FC_BYTE: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_BYTE */\n", var->type->type); + break; + case RPC_FC_CHAR: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_CHAR */\n", var->type->type); + break; + case RPC_FC_WCHAR: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_WCHAR */\n", var->type->type); + break; + case RPC_FC_USHORT: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_USHORT */\n", var->type->type); + break; + case RPC_FC_SHORT: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_SHORT */\n", var->type->type); + break; + case RPC_FC_ULONG: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_ULONG */\n", var->type->type); + break; + case RPC_FC_LONG: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_LONG */\n", var->type->type); + break; + case RPC_FC_HYPER: + print_client("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_client("0x%02x, /* RPC_FC_HYPER */\n", var->type->type); + break; + default: + error("Unknown/unsupported type\n"); + } } - cur = PREV_LINK(cur); + func = PREV_LINK(func); } print_client("0x0\n"); @@ -113,25 +198,153 @@ } +static void print_message_buffer_size(func_t *func) +{ + unsigned int alignment; + unsigned int size; + unsigned int last_size = 0; + var_t *var; + + if (!func->args) + { + fprintf(client, " 0U"); + return; + } + + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + alignment = 0; + switch (var->type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + size = 1; + alignment = 0; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + if (last_size != 0 && last_size < 2) + alignment += (2 - last_size); + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + size = 4; + if (last_size != 0 && last_size < 4) + alignment += (4 - last_size); + break; + + case RPC_FC_HYPER: + size = 8; + if (last_size != 0 && last_size < 4) + alignment += (4 - last_size); + break; + + default: + error("Unknown/unsupported type!"); + } + + if (last_size != 0) + fprintf(client, " +"); + fprintf(client, " %uU", size + alignment); + + last_size = size; + + var = PREV_LINK(var); + } +} + + +static void marshall_arguments(func_t *func) +{ + unsigned int alignment; + unsigned int size; + unsigned int last_size = 0; + var_t *var; + + if (!func->args) + return; + + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + alignment = 0; + switch (var->type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + size = 1; + alignment = 0; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + if (last_size != 0 && last_size < 2) + alignment = (2 - last_size); + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + size = 4; + if (last_size != 0 && last_size < 4) + alignment = (4 - last_size); + break; + + case RPC_FC_HYPER: + size = 8; + if (last_size != 0 && last_size < 4) + alignment = (4 - last_size); + break; + + default: + error("Unknown/unsupported type!"); + } + + if (alignment != 0) + print_client("_StubMsg.Buffer += %u;\n", alignment); + + print_client("*(("); + write_type(client, var->type, var, var->tname); + fprintf(client, " __RPC_FAR*)_StubMsg.Buffer)++ = "); + write_name(client, var); + fprintf(client, ";\n"); + fprintf(client, "\n"); + + last_size = size; + + var = PREV_LINK(var); + } +} + + static void write_function_stubs(type_t *iface) { - func_t *cur = iface->funcs; - char *handle_name = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + func_t *func = iface->funcs; + var_t* var; int method_count = 0; unsigned int proc_offset = 0; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { - var_t *def = cur->def; + var_t *def = func->def; write_type(client, def->type, def, def->tname); fprintf(client, " "); write_name(client, def); fprintf(client, "(\n"); indent++; - if (cur->args) - write_args(client, cur->args, iface->name, 0, TRUE); + if (func->args) + write_args(client, func->args, iface->name, 0, TRUE); else print_client("void"); fprintf(client, ")\n"); @@ -149,9 +362,8 @@ fprintf(client, " _RetVal;\n"); } - if (handle_name) + if (implicit_handle) print_client("RPC_BINDING_HANDLE _Handle = 0;\n"); - print_client("RPC_MESSAGE _RpcMessage;\n"); print_client("MIDL_STUB_MESSAGE _StubMsg;\n"); fprintf(client, "\n"); @@ -168,41 +380,42 @@ indent--; fprintf(client, "\n"); - if (handle_name) - print_client("_Handle = %s;\n", handle_name); + if (implicit_handle) + { + print_client("_Handle = %s;\n", implicit_handle); + fprintf(client, "\n"); + } - /* FIXME: marshal arguments */ - print_client("_StubMsg.BufferLength = 0UL;\n"); -// print_client("NdrNsGetBuffer(\n"); + /* emit the message buffer size */ + print_client("_StubMsg.BufferLength ="); + print_message_buffer_size(func); + fprintf(client, ";\n"); + + print_client("NdrGetBuffer(\n"); indent++; print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); print_client("_StubMsg.BufferLength,\n"); - if (handle_name) + if (implicit_handle) print_client("%_Handle);\n"); else print_client("%s__MIDL_AutoBindHandle);\n", iface->name); indent--; fprintf(client, "\n"); + /* marshal arguments */ + marshall_arguments(func); /* send/recieve message */ -// print_client("NdrNsSendReceive(\n"); print_client("NdrSendReceive(\n"); indent++; print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); print_client("(unsigned char __RPC_FAR *)_StubMsg.Buffer);\n"); -// print_client("(unsigned char __RPC_FAR *)_StubMsg.Buffer,\n"); -// print_client("(RPC_BINDING_HANDLE __RPC_FAR *) &%s__MIDL_AutoBindHandle);\n", iface->name); indent--; /* unmarshal return value */ - if (is_void(def->type, NULL)) + if (!is_void(def->type, NULL)) { - proc_offset += 2; - } - else - { fprintf(client, "\n"); print_client("if ((_RpcMessage.DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)\n"); @@ -210,17 +423,27 @@ print_client("NdrConvert(\n"); indent++; print_client("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); - print_client("(PFORMAT_STRING)&__MIDL_ProcFormatString[%u]);\n", proc_offset); + print_client("(PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);\n", proc_offset); indent -= 2; fprintf(client, "\n"); print_client("_RetVal = *(("); write_type(client, def->type, def, def->tname); fprintf(client, " __RPC_FAR *)_StubMsg.Buffer)++;\n"); + } - /* FIXME: update proc_offset */ - proc_offset += 2; + /* update proc_offset */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + proc_offset += 2; /* FIXME */ + var = PREV_LINK(var); + } } + proc_offset += 2; /* FIXME */ indent--; print_client("}\n"); @@ -250,7 +473,7 @@ fprintf(client, "\n"); method_count++; - cur = PREV_LINK(cur); + func = PREV_LINK(func); } } @@ -271,7 +494,7 @@ static void write_stubdescriptor(type_t *iface) { - char *handle_name = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); print_client("static const MIDL_STUB_DESC %s_StubDesc =\n", iface->name); print_client("{\n"); @@ -279,8 +502,8 @@ print_client("(void __RPC_FAR *)& %s___RpcClientInterface,\n", iface->name); print_client("MIDL_user_allocate,\n"); print_client("MIDL_user_free,\n"); - if (handle_name) - print_client("&%s,\n", handle_name); + if (implicit_handle) + print_client("&%s,\n", implicit_handle); else print_client("&%s__MIDL_AutoBindHandle,\n", iface->name); print_client("0,\n"); @@ -348,19 +571,34 @@ static void write_formatstringsdecl(type_t *iface) { - func_t *cur; int byte_count = 1; + func_t *func; + var_t *var; print_client("#define TYPE_FORMAT_STRING_SIZE %d\n", 3); /* FIXME */ /* determine the proc format string size */ - cur = iface->funcs; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + func = iface->funcs; + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { + /* argument list size */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + byte_count += 2; /* FIXME: determine real size */ + var = PREV_LINK(var); + } + } + + /* return value size */ byte_count += 2; /* FIXME: determine real size */ - cur = PREV_LINK(cur); + func = PREV_LINK(func); } + print_client("#define PROC_FORMAT_STRING_SIZE %d\n", byte_count); fprintf(client, "\n"); @@ -375,11 +613,11 @@ static void write_implicithandledecl(type_t *iface) { - char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); - if (var) + if (implicit_handle) { - fprintf(client, "handle_t %s;\n", var); + fprintf(client, "handle_t %s;\n", implicit_handle); fprintf(client, "\n"); } } _____ Modified: trunk/reactos/tools/widl/server.c --- trunk/reactos/tools/widl/server.c 2005-02-23 10:37:46 UTC (rev 13724) +++ trunk/reactos/tools/widl/server.c 2005-02-23 13:15:40 UTC (rev 13725) @@ -63,7 +63,8 @@ static void write_procformatstring(type_t *iface) { - func_t *cur = iface->funcs; + func_t *func = iface->funcs; + var_t *var; print_server("static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =\n"); print_server("{\n"); @@ -72,23 +73,107 @@ print_server("{\n"); indent++; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { - var_t *def = cur->def; + /* emit argument data */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + switch(var->type->type) + { + case RPC_FC_BYTE: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_BYTE */\n", var->type->type); + break; + case RPC_FC_CHAR: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_CHAR */\n", var->type->type); + break; + case RPC_FC_WCHAR: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_WCHAR */\n", var->type->type); + break; + case RPC_FC_USHORT: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_USHORT */\n", var->type->type); + break; + case RPC_FC_SHORT: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_SHORT */\n", var->type->type); + break; + case RPC_FC_ULONG: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_ULONG */\n", var->type->type); + break; + case RPC_FC_LONG: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_LONG */\n", var->type->type); + break; + case RPC_FC_HYPER: + print_server("0x4e, /* FC_IN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_HYPER */\n", var->type->type); + break; + default: + error("Unknown/unsupported type\n"); + } - if (is_void(def->type, NULL)) + var = PREV_LINK(var); + } + } + + /* emit return value data */ + var = func->def; + if (is_void(var->type, NULL)) { print_server("0x5b, /* FC_END */\n"); print_server("0x5c, /* FC_PAD */\n"); } else { - print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); - print_server("0x%02x, /* <type> */\n", def->type->type); + switch(var->type->type) + { + case RPC_FC_BYTE: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_BYTE */\n", var->type->type); + break; + case RPC_FC_CHAR: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_CHAR */\n", var->type->type); + break; + case RPC_FC_WCHAR: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_WCHAR */\n", var->type->type); + break; + case RPC_FC_USHORT: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_USHORT */\n", var->type->type); + break; + case RPC_FC_SHORT: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_SHORT */\n", var->type->type); + break; + case RPC_FC_ULONG: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_ULONG */\n", var->type->type); + break; + case RPC_FC_LONG: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_LONG */\n", var->type->type); + break; + case RPC_FC_HYPER: + print_server("0x53, /* FC_RETURN_PARAM_BASETYPE */\n"); + print_server("0x%02x, /* RPC_FC_HYPER */\n", var->type->type); + break; + default: + error("Unknown/unsupported type\n"); + } } - cur = PREV_LINK(cur); + func = PREV_LINK(func); } print_server("0x0\n"); @@ -118,7 +203,7 @@ } -unsigned int get_required_stack_size(type_t *type) +unsigned int get_required_buffer_size(type_t *type) { switch(type->type) { @@ -140,13 +225,81 @@ } +static void unmarshall_arguments(func_t *func) +{ + unsigned int alignment; + unsigned int size; + unsigned int last_size = 0; + var_t *var; + + if (!func->args) + return; + + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + alignment = 0; + switch (var->type->type) + { + case RPC_FC_BYTE: + case RPC_FC_CHAR: + size = 1; + alignment = 0; + break; + + case RPC_FC_WCHAR: + case RPC_FC_USHORT: + case RPC_FC_SHORT: + size = 2; + if (last_size != 0 && last_size < 2) + alignment = (2 - last_size); + break; + + case RPC_FC_ULONG: + case RPC_FC_LONG: + size = 4; + if (last_size != 0 && last_size < 4) + alignment = (4 - last_size); + break; + + case RPC_FC_HYPER: + size = 8; + if (last_size != 0 && last_size < 4) + alignment = (4 - last_size); + break; + + default: + error("Unknown/unsupported type!"); + } + + if (alignment != 0) + print_server("_StubMsg.Buffer += %u;\n", alignment); + + print_server(""); + write_name(server, var); + fprintf(server, " = *(("); + write_type(server, var->type, var, var->tname); + fprintf(server, " __RPC_FAR*)_StubMsg.Buffer)++;\n"); + fprintf(server, "\n"); + + last_size = size; + + var = PREV_LINK(var); + } +} + + static void write_function_stubs(type_t *iface) { - func_t *cur = iface->funcs; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + func_t *func = iface->funcs; + var_t *var; + unsigned int proc_offset = 0; + + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { - var_t *def = cur->def; + var_t *def = func->def; write_type(server, def->type, def, def->tname); fprintf(server, " __RPC_STUB\n"); @@ -169,9 +322,28 @@ fprintf(server, " _RetVal;\n"); } + /* declare arguments */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + print_server(""); + write_type(server, var->type, var, var->tname); + fprintf(server, " "); + write_name(server, var); + fprintf(server, ";\n"); + + var = PREV_LINK(var); + } + } + print_server("MIDL_STUB_MESSAGE _StubMsg;\n"); print_server("RPC_STATUS _Status;\n"); fprintf(server, "\n"); + + print_server("((void)(_Status));\n"); print_server("NdrServerInitializeNew(\n"); indent++; @@ -187,6 +359,21 @@ print_server("RpcTryExcept\n"); print_server("{\n"); indent++; + + if (func->args) + { + print_server("if ((_pRpcMessage->DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)\n"); + indent++; + print_server("NdrConvert(\n"); + indent++; + print_server("(PMIDL_STUB_MESSAGE)&_StubMsg,\n"); + print_server("(PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);\n", proc_offset); + indent -= 2; + fprintf(server, "\n"); + + unmarshall_arguments(func); + } + print_server("if (_StubMsg.Buffer > _StubMsg.BufferEnd)\n"); print_server("{\n"); indent++; @@ -212,14 +399,37 @@ print_server(""); write_name(server, def); - /* FIXME: handle argument list */ - fprintf(server, "();\n"); + if (func->args) + { + int first_arg = 1; - /* FIXME: Marshall the return value */ + fprintf(server, "(\n"); + indent++; + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + if (first_arg) + first_arg = 0; + else + fprintf(server, ",\n"); + print_server(""); + write_name(server, var); + var = PREV_LINK(var); + } + fprintf(server, ");\n"); + indent--; + } + else + { + fprintf(server, "();\n"); + } + + /* marshall the return value */ if (!is_void(def->type, NULL)) { fprintf(server, "\n"); - print_server("_StubMsg.BufferLength = %uU;\n", get_required_stack_size(def->type)); + print_server("_StubMsg.BufferLength = %uU;\n", get_required_buffer_size(def->type)); print_server("_pRpcMessage->BufferLength = _StubMsg.BufferLength;\n"); fprintf(server, "\n"); print_server("_Status = I_RpcGetBuffer(_pRpcMessage);\n"); @@ -253,7 +463,20 @@ fprintf(server, "}\n"); fprintf(server, "\n"); - cur = PREV_LINK(cur); + /* update proc_offset */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + proc_offset += 2; /* FIXME */ + var = PREV_LINK(var); + } + } + proc_offset += 2; /* FIXME */ + + func = PREV_LINK(func); } } @@ -375,18 +598,32 @@ static void write_formatstringsdecl(type_t *iface) { - func_t *cur; + func_t *func; + var_t *var; int byte_count = 1; print_server("#define TYPE_FORMAT_STRING_SIZE %d\n", 3); /* FIXME */ /* determine the proc format string size */ - cur = iface->funcs; - while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); - while (cur) + func = iface->funcs; + while (NEXT_LINK(func)) func = NEXT_LINK(func); + while (func) { + /* argument list size */ + if (func->args) + { + var = func->args; + while (NEXT_LINK(var)) var = NEXT_LINK(var); + while (var) + { + byte_count += 2; /* FIXME: determine real size */ + var = PREV_LINK(var); + } + } + + /* return value size */ byte_count += 2; /* FIXME: determine real size */ - cur = PREV_LINK(cur); + func = PREV_LINK(func); } print_server("#define PROC_FORMAT_STRING_SIZE %d\n", byte_count);
19 years, 10 months
1
0
0
0
[weiden] 13724: added msacm32.dll to the bootcd
by weiden@svn.reactos.com
added msacm32.dll to the bootcd Modified: trunk/reactos/bootdata/packages/reactos.dff _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-02-23 09:56:36 UTC (rev 13723) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-02-23 10:37:46 UTC (rev 13724) @@ -96,6 +96,7 @@ lib\midimap\midimap.dll 1 lib\mmdrv\mmdrv.dll 1 lib\mpr\mpr.dll 1 +lib\msacm\msacm32.dll 1 lib\msafd\msafd.dll 1 lib\msgina\msgina.dll 1 lib\msimg32\msimg32.dll 1
19 years, 10 months
1
0
0
0
[weiden] 13723: added more irql checks
by weiden@svn.reactos.com
added more irql checks Modified: trunk/reactos/lib/rtl/random.c Modified: trunk/reactos/lib/rtl/registry.c Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c _____ Modified: trunk/reactos/lib/rtl/random.c --- trunk/reactos/lib/rtl/random.c 2005-02-23 08:16:19 UTC (rev 13722) +++ trunk/reactos/lib/rtl/random.c 2005-02-23 09:56:36 UTC (rev 13723) @@ -27,6 +27,7 @@ /* INCLUDES *****************************************************************/ #include <ddk/ntddk.h> +#include <ntdll/rtl.h> #define NDEBUG #include <debug.h> @@ -88,6 +89,8 @@ ULONG Rand; int Pos; ULONG Result; + + PAGED_CODE_RTL(); Rand = (*Seed * 0x7fffffed + 0x7fffffc3) % 0x7fffffff; *Seed = (Rand * 0x7fffffed + 0x7fffffc3) % 0x7fffffff; _____ Modified: trunk/reactos/lib/rtl/registry.c --- trunk/reactos/lib/rtl/registry.c 2005-02-23 08:16:19 UTC (rev 13722) +++ trunk/reactos/lib/rtl/registry.c 2005-02-23 09:56:36 UTC (rev 13723) @@ -165,6 +165,8 @@ { HANDLE KeyHandle; NTSTATUS Status; + + PAGED_CODE_RTL(); Status = RtlpGetRegistryHandle(RelativeTo, Path, @@ -188,6 +190,8 @@ { HANDLE KeyHandle; NTSTATUS Status; + + PAGED_CODE_RTL(); Status = RtlpGetRegistryHandle(RelativeTo, Path, @@ -213,6 +217,8 @@ HANDLE KeyHandle; NTSTATUS Status; UNICODE_STRING Name; + + PAGED_CODE_RTL(); Status = RtlpGetRegistryHandle(RelativeTo, (PWSTR)Path, @@ -245,6 +251,8 @@ ULONG Length; UNICODE_STRING SidString; NTSTATUS Status; + + PAGED_CODE_RTL(); DPRINT ("RtlFormatCurrentUserKeyPath() called\n"); @@ -299,7 +307,7 @@ KeyPath->Length = 0; KeyPath->MaximumLength = Length; - KeyPath->Buffer = ExAllocatePool (NonPagedPool, + KeyPath->Buffer = ExAllocatePool (PagedPool, KeyPath->MaximumLength); if (KeyPath->Buffer == NULL) { @@ -328,6 +336,8 @@ OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyPath; NTSTATUS Status; + + PAGED_CODE_RTL(); Status = RtlFormatCurrentUserKeyPath(&KeyPath); if (NT_SUCCESS(Status)) @@ -390,6 +400,8 @@ PWSTR ValueName; UNICODE_STRING EnvValue; UNICODE_STRING EnvExpandedValue; + + PAGED_CODE_RTL(); DPRINT("RtlQueryRegistryValues() called\n"); @@ -878,6 +890,8 @@ HANDLE KeyHandle; NTSTATUS Status; UNICODE_STRING Name; + + PAGED_CODE_RTL(); Status = RtlpGetRegistryHandle(RelativeTo, (PWSTR)Path, _____ Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c --- trunk/reactos/ntoskrnl/cm/ntfunc.c 2005-02-23 08:16:19 UTC (rev 13722) +++ trunk/reactos/ntoskrnl/cm/ntfunc.c 2005-02-23 09:56:36 UTC (rev 13723) @@ -39,6 +39,8 @@ { PREGISTRY_CALLBACK Callback; + PAGED_CODE(); + ASSERT(Function && Cookie); Callback = ExAllocatePoolWithTag(PagedPool, @@ -76,6 +78,8 @@ CmUnRegisterCallback(IN LARGE_INTEGER Cookie) { PLIST_ENTRY CurrentEntry; + + PAGED_CODE(); ExAcquireFastMutex(&CmiCallbackLock); @@ -129,6 +133,8 @@ { PLIST_ENTRY CurrentEntry; + PAGED_CODE(); + ExAcquireFastMutex(&CmiCallbackLock); for(CurrentEntry = CmiCallbackHead.Flink; @@ -184,6 +190,8 @@ PVOID Object; PWSTR Start; unsigned i; + + PAGED_CODE(); DPRINT("NtCreateKey (Name %wZ KeyHandle %x Root %x)\n", ObjectAttributes->ObjectName, @@ -365,6 +373,8 @@ KPROCESSOR_MODE PreviousMode; PKEY_OBJECT KeyObject; NTSTATUS Status; + + PAGED_CODE(); DPRINT1("NtDeleteKey(KeyHandle %x) called\n", KeyHandle); @@ -445,6 +455,8 @@ PDATA_CELL ClassCell; ULONG NameSize, ClassSize; NTSTATUS Status; + + PAGED_CODE(); DPRINT("KH %x I %d KIC %x KI %x L %d RL %x\n", KeyHandle, @@ -792,6 +804,8 @@ PKEY_VALUE_BASIC_INFORMATION ValueBasicInformation; PKEY_VALUE_PARTIAL_INFORMATION ValuePartialInformation; PKEY_VALUE_FULL_INFORMATION ValueFullInformation; + + PAGED_CODE(); DPRINT("KH %x I %d KVIC %x KVI %x L %d RL %x\n", KeyHandle, @@ -1028,6 +1042,8 @@ PKEY_OBJECT KeyObject; PREGISTRY_HIVE RegistryHive; KPROCESSOR_MODE PreviousMode; + + PAGED_CODE(); DPRINT("NtFlushKey (KeyHandle %lx) called\n", KeyHandle); @@ -1082,6 +1098,8 @@ PVOID Object; HANDLE hKey; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); DPRINT("NtOpenKey(KH %x DA %x OA %x OA->ON '%wZ'\n", KeyHandle, @@ -1183,6 +1201,8 @@ PKEY_CELL KeyCell; ULONG NameSize, ClassSize; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtQueryKey(KH %x KIC %x KI %x L %d RL %x)\n", KeyHandle, @@ -1384,6 +1404,8 @@ PKEY_VALUE_BASIC_INFORMATION ValueBasicInformation; PKEY_VALUE_PARTIAL_INFORMATION ValuePartialInformation; PKEY_VALUE_FULL_INFORMATION ValueFullInformation; + + PAGED_CODE(); DPRINT("NtQueryValueKey(KeyHandle %x ValueName %S Length %x)\n", KeyHandle, ValueName->Buffer, Length); @@ -1624,6 +1646,8 @@ PDATA_CELL NewDataCell; PHBIN pBin; ULONG DesiredAccess; + + PAGED_CODE(); DPRINT("NtSetValueKey(KeyHandle %x ValueName '%wZ' Type %d)\n", KeyHandle, ValueName, Type); @@ -1779,6 +1803,8 @@ { PKEY_OBJECT KeyObject; NTSTATUS Status; + + PAGED_CODE(); /* Verify that the handle is valid and is a registry key */ Status = ObReferenceObjectByHandle(KeyHandle, @@ -1850,6 +1876,8 @@ ULONG BufferSize; ULONG Length; NTSTATUS Status; + + PAGED_CODE(); DPRINT ("NtLoadKey2() called\n"); @@ -1988,6 +2016,8 @@ NTSTATUS Status; PUCHAR DataPtr; ULONG i; + + PAGED_CODE(); /* Verify that the handle is valid and is a registry key */ Status = ObReferenceObjectByHandle(KeyHandle, @@ -2116,6 +2146,8 @@ PREGISTRY_HIVE TempHive; PKEY_OBJECT KeyObject; NTSTATUS Status; + + PAGED_CODE(); DPRINT ("NtSaveKey() called\n"); @@ -2218,6 +2250,8 @@ { PKEY_OBJECT KeyObject; NTSTATUS Status; + + PAGED_CODE(); if (KeyInformationClass != KeyWriteTimeInformation) return STATUS_INVALID_INFO_CLASS; @@ -2274,6 +2308,8 @@ { PREGISTRY_HIVE RegistryHive; NTSTATUS Status; + + PAGED_CODE(); DPRINT ("NtUnloadKey() called\n"); @@ -2320,6 +2356,8 @@ NtInitializeRegistry (IN BOOLEAN SetUpBoot) { NTSTATUS Status; + + PAGED_CODE(); if (CmiRegistryInitialized == TRUE) return STATUS_ACCESS_DENIED;
19 years, 10 months
1
0
0
0
[gvg] 13722: tinus <o112w8r02@sneakemail.com>
by gvg@svn.reactos.com
tinus <o112w8r02(a)sneakemail.com> Cleanup the timers after sending WM_NCDESTROY Modified: trunk/reactos/subsys/win32k/ntuser/window.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-02-23 08:14:48 UTC (rev 13721) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-02-23 08:16:19 UTC (rev 13722) @@ -267,8 +267,6 @@ BOOLEAN BelongsToThreadData; ASSERT(Window); - - MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->Self); IntLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread); if(Window->Status & WINDOWSTATUS_DESTROYING) @@ -326,6 +324,7 @@ if(BelongsToThreadData) IntSendMessage(Window->Self, WM_NCDESTROY, 0, 0); } + MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->Self); /* flush the message queue */ MsqRemoveWindowMessagesFromQueue(Window);
19 years, 10 months
1
0
0
0
[gvg] 13721: tinus <o112w8r02@sneakemail.com>
by gvg@svn.reactos.com
tinus <o112w8r02(a)sneakemail.com> Fix the caret timer warnings Don't kill the timer unless we added it. Modified: trunk/reactos/subsys/win32k/ntuser/caret.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/caret.c --- trunk/reactos/subsys/win32k/ntuser/caret.c 2005-02-22 22:19:14 UTC (rev 13720) +++ trunk/reactos/subsys/win32k/ntuser/caret.c 2005-02-23 08:14:48 UTC (rev 13721) @@ -240,12 +240,14 @@ return FALSE; } - IntKillTimer(hWnd, IDCARETTIMER, TRUE); - ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue; + + if (ThreadQueue->CaretInfo->Visible) + { + IntKillTimer(hWnd, IDCARETTIMER, TRUE); + IntHideCaret(ThreadQueue->CaretInfo); + } - IntHideCaret(ThreadQueue->CaretInfo); - ThreadQueue->CaretInfo->hWnd = hWnd; if(hBitmap) {
19 years, 10 months
1
0
0
0
[weiden] 13720: added more irql checks
by weiden@svn.reactos.com
added more irql checks Modified: trunk/reactos/ntoskrnl/ex/callback.c Modified: trunk/reactos/ntoskrnl/ex/event.c Modified: trunk/reactos/ntoskrnl/ex/evtpair.c Modified: trunk/reactos/ntoskrnl/ex/mutant.c Modified: trunk/reactos/ntoskrnl/ex/profile.c Modified: trunk/reactos/ntoskrnl/ex/rundown.c Modified: trunk/reactos/ntoskrnl/ex/sem.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/time.c Modified: trunk/reactos/ntoskrnl/ex/timer.c Modified: trunk/reactos/ntoskrnl/ex/uuid.c Modified: trunk/reactos/ntoskrnl/rtl/capture.c _____ Modified: trunk/reactos/ntoskrnl/ex/callback.c --- trunk/reactos/ntoskrnl/ex/callback.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/callback.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -171,6 +171,8 @@ PINT_CALLBACK_OBJECT Callback; NTSTATUS Status; HANDLE Handle; + + PAGED_CODE(); /* Open a handle to the callback if it exists */ if (ObjectAttributes->ObjectName) @@ -346,6 +348,8 @@ PINT_CALLBACK_OBJECT CallbackObject = (PINT_CALLBACK_OBJECT)OpaqueCallbackObject; PCALLBACK_REGISTRATION CallbackRegistration = NULL; KIRQL OldIrql; + + PAGED_CODE(); /* Create reference to Callback Object */ ObReferenceObject (CallbackObject); @@ -411,6 +415,8 @@ PCALLBACK_REGISTRATION CallbackRegistration; PINT_CALLBACK_OBJECT CallbackObject; KIRQL OldIrql; + + PAGED_CODE(); /* Convert Handle to valid Structure Pointer */ CallbackRegistration = (PCALLBACK_REGISTRATION) CallbackRegistrationHandle; _____ Modified: trunk/reactos/ntoskrnl/ex/event.c --- trunk/reactos/ntoskrnl/ex/event.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/event.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -88,6 +88,8 @@ PKEVENT Event; NTSTATUS Status; + PAGED_CODE(); + Status = ObReferenceObjectByHandle(EventHandle, EVENT_MODIFY_STATE, ExEventObjectType, @@ -118,6 +120,8 @@ PKEVENT Event; HANDLE hEvent; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -195,6 +199,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + DPRINT("NtOpenEvent(0x%x, 0x%x, 0x%x)\n", EventHandle, DesiredAccess, ObjectAttributes); PreviousMode = ExGetPreviousMode(); @@ -254,6 +260,8 @@ PKEVENT Event; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); DPRINT("NtPulseEvent(EventHandle 0%x PreviousState 0%x)\n", EventHandle, PreviousState); @@ -322,6 +330,8 @@ PKEVENT Event; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -395,6 +405,8 @@ PKEVENT Event; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); DPRINT("NtResetEvent(EventHandle 0%x PreviousState 0%x)\n", EventHandle, PreviousState); @@ -460,6 +472,8 @@ PKEVENT Event; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); DPRINT("NtSetEvent(EventHandle 0%x PreviousState 0%x)\n", EventHandle, PreviousState); _____ Modified: trunk/reactos/ntoskrnl/ex/evtpair.c --- trunk/reactos/ntoskrnl/ex/evtpair.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/evtpair.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -95,6 +95,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousMode == UserMode) @@ -168,6 +170,8 @@ HANDLE hEventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -221,6 +225,8 @@ PKEVENT_PAIR EventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtSetHighEventPair(EventPairHandle %x)\n", EventPairHandle); @@ -252,6 +258,8 @@ PKEVENT_PAIR EventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtSetHighWaitLowEventPair(EventPairHandle %x)\n", EventPairHandle); @@ -289,6 +297,8 @@ PKEVENT_PAIR EventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtSetLowEventPair(EventPairHandle %x)\n", EventPairHandle); @@ -320,6 +330,8 @@ PKEVENT_PAIR EventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtSetLowWaitHighEventPair(EventPairHandle %x)\n", EventPairHandle); @@ -357,6 +369,8 @@ PKEVENT_PAIR EventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtWaitLowEventPair(EventPairHandle %x)\n", EventPairHandle); @@ -390,6 +404,8 @@ PKEVENT_PAIR EventPair; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtWaitHighEventPair(EventPairHandle %x)\n", EventPairHandle); @@ -436,6 +452,8 @@ NTSTATUS Status; KIRQL Irql; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(!Thread->EventPair) @@ -489,6 +507,8 @@ PKEVENT_PAIR EventPair; NTSTATUS Status; KIRQL Irql; + + PAGED_CODE(); Thread = PsGetCurrentThread(); _____ Modified: trunk/reactos/ntoskrnl/ex/mutant.c --- trunk/reactos/ntoskrnl/ex/mutant.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/mutant.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -104,27 +104,29 @@ PKMUTEX Mutant; NTSTATUS Status = STATUS_SUCCESS; - PreviousMode = ExGetPreviousMode(); + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); - if(PreviousMode == UserMode) - { - _SEH_TRY - { - ProbeForWrite(MutantHandle, - sizeof(HANDLE), - sizeof(ULONG)); - } - _SEH_HANDLE - { - Status = _SEH_GetExceptionCode(); - } - _SEH_END; + if(PreviousMode == UserMode) + { + _SEH_TRY + { + ProbeForWrite(MutantHandle, + sizeof(HANDLE), + sizeof(ULONG)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; - if(!NT_SUCCESS(Status)) - { - return Status; - } - } + if(!NT_SUCCESS(Status)) + { + return Status; + } + } Status = ObCreateObject(PreviousMode, ExMutantObjectType, @@ -177,6 +179,8 @@ HANDLE hMutant; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); DPRINT("NtOpenMutant(0x%x, 0x%x, 0x%x)\n", MutantHandle, DesiredAccess, ObjectAttributes); @@ -240,6 +244,8 @@ PKMUTANT Mutant; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -311,6 +317,8 @@ PKMUTANT Mutant; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); DPRINT("NtReleaseMutant(MutantHandle 0%x PreviousCount 0%x)\n", MutantHandle, PreviousCount); _____ Modified: trunk/reactos/ntoskrnl/ex/profile.c --- trunk/reactos/ntoskrnl/ex/profile.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/profile.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -109,6 +109,8 @@ OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(BufferSize == 0) @@ -271,6 +273,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousMode != KernelMode) @@ -329,6 +333,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); Status = ObReferenceObjectByHandle(ProfileHandle, @@ -353,6 +359,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); Status = ObReferenceObjectByHandle(ProfileHandle, _____ Modified: trunk/reactos/ntoskrnl/ex/rundown.c --- trunk/reactos/ntoskrnl/ex/rundown.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/rundown.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -41,6 +41,8 @@ { ULONG_PTR PrevCount, Current; + PAGED_CODE(); + Count <<= EX_RUNDOWN_COUNT_SHIFT; /* Loop until successfully incremented the counter */ @@ -74,6 +76,8 @@ IN PEX_RUNDOWN_REF RunRef ) { + PAGED_CODE(); + /* Set the count to zero */ RunRef->Count = 0; } @@ -87,6 +91,8 @@ IN PEX_RUNDOWN_REF RunRef ) { + PAGED_CODE(); + /* Reset the count */ #ifdef _WIN64 InterlockedExchangeAdd64((LONGLONG*)&RunRef->Count, 0LL); @@ -106,6 +112,8 @@ IN ULONG Count ) { + PAGED_CODE(); + Count <<= EX_RUNDOWN_COUNT_SHIFT; for (;;) @@ -200,7 +208,9 @@ IN PEX_RUNDOWN_REF RunRef ) { - /* mark the */ + PAGED_CODE(); + + /* mark the counter as active */ #ifdef _WIN64 InterlockedExchange64((LONGLONG*)&RunRef->Count, (LONGLONG)EX_RUNDOWN_ACTIVE); #else @@ -220,6 +230,8 @@ ULONG_PTR PrevCount, NewPtr, PrevPtr; RUNDOWN_DESCRIPTOR RundownDescriptor; + PAGED_CODE(); + PrevCount = RunRef->Count; if (PrevCount != 0 && !(PrevCount & EX_RUNDOWN_ACTIVE)) _____ Modified: trunk/reactos/ntoskrnl/ex/sem.c --- trunk/reactos/ntoskrnl/ex/sem.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/sem.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -91,6 +91,8 @@ HANDLE hSemaphore; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -167,6 +169,8 @@ HANDLE hSemaphore; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -227,6 +231,8 @@ PKSEMAPHORE Semaphore; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -299,6 +305,8 @@ PKSEMAPHORE Semaphore; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousCount != NULL && PreviousMode == UserMode) _____ Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c --- trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -101,6 +101,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousMode != KernelMode) @@ -245,6 +247,8 @@ ANSI_STRING AName, AValue; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); @@ -1371,6 +1375,8 @@ PVOID SystemInformation; NTSTATUS Status; NTSTATUS FStatus; + + PAGED_CODE(); /* DPRINT("NtQuerySystemInformation Start. Class:%d\n", SystemInformationClass ); @@ -1448,6 +1454,8 @@ IN ULONG SystemInformationLength ) { + PAGED_CODE(); + /* * If called from user mode, check * possible unsafe arguments. @@ -1496,6 +1504,8 @@ IN UINT NumberOfBytesToFlush ) { + PAGED_CODE(); + __asm__("wbinvd\n"); return STATUS_SUCCESS; } _____ Modified: trunk/reactos/ntoskrnl/ex/time.c --- trunk/reactos/ntoskrnl/ex/time.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/time.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -151,6 +151,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousMode != KernelMode) @@ -233,6 +235,8 @@ { KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); PreviousMode = ExGetPreviousMode(); _____ Modified: trunk/reactos/ntoskrnl/ex/timer.c --- trunk/reactos/ntoskrnl/ex/timer.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/timer.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -209,12 +209,16 @@ OUT PBOOLEAN CurrentState OPTIONAL) { PETIMER Timer; - KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); - NTSTATUS Status = STATUS_SUCCESS; + KPROCESSOR_MODE PreviousMode; BOOLEAN State; KIRQL OldIrql; + PETHREAD TimerThread; BOOLEAN KillTimer = FALSE; - PETHREAD TimerThread; + NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); DPRINT("NtCancelTimer(0x%x, 0x%x)\n", TimerHandle, CurrentState); @@ -319,8 +323,12 @@ { PETIMER Timer; HANDLE hTimer; - KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); + KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); DPRINT("NtCreateTimer(Handle: %x, Type: %d)\n", TimerHandle, TimerType); @@ -398,8 +406,12 @@ IN POBJECT_ATTRIBUTES ObjectAttributes) { HANDLE hTimer; - KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); + KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); DPRINT("NtOpenTimer(TimerHandle: %x)\n", TimerHandle); @@ -452,9 +464,13 @@ OUT PULONG ReturnLength OPTIONAL) { PETIMER Timer; - KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); + KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; PTIMER_BASIC_INFORMATION BasicInfo = (PTIMER_BASIC_INFORMATION)TimerInformation; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); DPRINT("NtQueryTimer(TimerHandle: %x, Class: %d)\n", TimerHandle, TimerInformationClass); @@ -522,13 +538,18 @@ { PETIMER Timer; KIRQL OldIrql; - BOOLEAN KillTimer = FALSE; BOOLEAN State; - KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); - PETHREAD CurrentThread = PsGetCurrentThread(); - NTSTATUS Status = STATUS_SUCCESS; + KPROCESSOR_MODE PreviousMode; + PETHREAD CurrentThread; LARGE_INTEGER TimerDueTime; PETHREAD TimerThread; + BOOLEAN KillTimer = FALSE; + NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); + CurrentThread = PsGetCurrentThread(); DPRINT("NtSetTimer(TimerHandle: %x, DueTime: %d, Apc: %x, Period: %d)\n", TimerHandle, DueTime->QuadPart, TimerApcRoutine, Period); _____ Modified: trunk/reactos/ntoskrnl/ex/uuid.c --- trunk/reactos/ntoskrnl/ex/uuid.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/ex/uuid.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -223,6 +223,8 @@ ULARGE_INTEGER IntTime; ULONG IntRange; NTSTATUS Status; + + PAGED_CODE(); ExAcquireFastMutex(&UuidMutex); @@ -278,6 +280,8 @@ NTSTATUS STDCALL NtSetUuidSeed(IN PUCHAR Seed) { + PAGED_CODE(); + RtlCopyMemory(UuidSeed, Seed, SEED_BUFFER_SIZE); _____ Modified: trunk/reactos/ntoskrnl/rtl/capture.c --- trunk/reactos/ntoskrnl/rtl/capture.c 2005-02-22 22:08:04 UTC (rev 13719) +++ trunk/reactos/ntoskrnl/rtl/capture.c 2005-02-22 22:19:14 UTC (rev 13720) @@ -125,46 +125,6 @@ } } -NTSTATUS -RtlCaptureAnsiString(PANSI_STRING Dest, - PANSI_STRING UnsafeSrc) -{ - PANSI_STRING Src; - NTSTATUS Status; - - /* - * Copy the source string structure to kernel space. - */ - Status = MmCopyFromCaller(&Src, UnsafeSrc, sizeof(ANSI_STRING)); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - /* - * Initialize the destination string. - */ - Dest->Length = Src->Length; - Dest->MaximumLength = Src->MaximumLength; - Dest->Buffer = ExAllocatePool(NonPagedPool, Dest->MaximumLength); - if (Dest->Buffer == NULL) - { - return(Status); - } - - /* - * Copy the source string to kernel space. - */ - Status = MmCopyFromCaller(Dest->Buffer, Src->Buffer, Dest->Length); - if (!NT_SUCCESS(Status)) - { - ExFreePool(Dest->Buffer); - return(Status); - } - - return(STATUS_SUCCESS); -} - /* * @unimplemented */
19 years, 10 months
1
0
0
0
[ekohl] 13719: Remove accidentially committed changes.
by ekohl@svn.reactos.com
Remove accidentially committed changes. Modified: trunk/reactos/rules.mak _____ Modified: trunk/reactos/rules.mak --- trunk/reactos/rules.mak 2005-02-22 21:09:54 UTC (rev 13718) +++ trunk/reactos/rules.mak 2005-02-22 22:08:04 UTC (rev 13719) @@ -1,7 +1,3 @@ -export VERBOSE = yes -export BUILD_MAP = yes -export BUILD_SYM = no - # Default to half-verbose mode ifeq ($(VERBOSE),no) Q = @
19 years, 10 months
1
0
0
0
[weiden] 13718: added more irql checks and secured access to buffers in symbolic link code
by weiden@svn.reactos.com
added more irql checks and secured access to buffers in symbolic link code Modified: trunk/reactos/ntoskrnl/cm/cm.h Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c Modified: trunk/reactos/ntoskrnl/ob/dirobj.c Modified: trunk/reactos/ntoskrnl/ob/handle.c Modified: trunk/reactos/ntoskrnl/ob/namespc.c Modified: trunk/reactos/ntoskrnl/ob/ntobj.c Modified: trunk/reactos/ntoskrnl/ob/object.c Modified: trunk/reactos/ntoskrnl/ob/security.c Modified: trunk/reactos/ntoskrnl/ob/symlink.c Modified: trunk/reactos/ntoskrnl/po/power.c _____ Modified: trunk/reactos/ntoskrnl/cm/cm.h --- trunk/reactos/ntoskrnl/cm/cm.h 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/cm/cm.h 2005-02-22 21:09:54 UTC (rev 13718) @@ -431,6 +431,7 @@ PEX_CALLBACK_FUNCTION Function; PVOID Context; LARGE_INTEGER Cookie; + BOOLEAN PendingDelete; } REGISTRY_CALLBACK, *PREGISTRY_CALLBACK; NTSTATUS _____ Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c --- trunk/reactos/ntoskrnl/cm/ntfunc.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/cm/ntfunc.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -50,6 +50,7 @@ ExInitializeRundownProtection(&Callback->RundownRef); Callback->Function = Function; Callback->Context = Context; + Callback->PendingDelete = FALSE; /* add it to the callback list and receive a cookie for the callback */ ExAcquireFastMutex(&CmiCallbackLock); @@ -87,22 +88,32 @@ CurrentCallback = CONTAINING_RECORD(CurrentEntry, REGISTRY_CALLBACK, ListEntry); if(CurrentCallback->Cookie.QuadPart == Cookie.QuadPart) { - /* found the callback, don't unlink it from the list yet so we don't screw - the calling loop */ - ExReleaseFastMutex(&CmiCallbackLock); + if(!CurrentCallback->PendingDelete) + { + /* found the callback, don't unlink it from the list yet so we don't screw + the calling loop */ + CurrentCallback->PendingDelete = TRUE; + ExReleaseFastMutex(&CmiCallbackLock); - /* if the callback is currently executing, wait until it finished */ - ExWaitForRundownProtectionRelease(&CurrentCallback->RundownRef); + /* if the callback is currently executing, wait until it finished */ + ExWaitForRundownProtectionRelease(&CurrentCallback->RundownRef); - /* time to unlink it. It's now safe because every attempt to acquire a - runtime protection on this callback will fail */ - ExAcquireFastMutex(&CmiCallbackLock); - RemoveEntryList(&CurrentCallback->ListEntry); - ExReleaseFastMutex(&CmiCallbackLock); + /* time to unlink it. It's now safe because every attempt to acquire a + runtime protection on this callback will fail */ + ExAcquireFastMutex(&CmiCallbackLock); + RemoveEntryList(&CurrentCallback->ListEntry); + ExReleaseFastMutex(&CmiCallbackLock); - /* free the callback */ - ExFreePool(CurrentCallback); - return STATUS_SUCCESS; + /* free the callback */ + ExFreePool(CurrentCallback); + return STATUS_SUCCESS; + } + else + { + /* pending delete, pretend like it already is deleted */ + ExReleaseFastMutex(&CmiCallbackLock); + return STATUS_UNSUCCESSFUL; + } } } @@ -127,7 +138,8 @@ PREGISTRY_CALLBACK CurrentCallback; CurrentCallback = CONTAINING_RECORD(CurrentEntry, REGISTRY_CALLBACK, ListEntry); - if(ExAcquireRundownProtectionEx(&CurrentCallback->RundownRef, 1)) + if(!CurrentCallback->PendingDelete && + ExAcquireRundownProtectionEx(&CurrentCallback->RundownRef, 1)) { NTSTATUS Status; _____ Modified: trunk/reactos/ntoskrnl/ob/dirobj.c --- trunk/reactos/ntoskrnl/ob/dirobj.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/dirobj.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -50,6 +50,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousMode != KernelMode) @@ -169,6 +171,8 @@ ULONG NextEntry = 0; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + PreviousMode = ExGetPreviousMode(); if(PreviousMode != KernelMode) @@ -427,6 +431,8 @@ KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; + PAGED_CODE(); + DPRINT("NtCreateDirectoryObject(DirectoryHandle %x, " "DesiredAccess %x, ObjectAttributes %x\n", DirectoryHandle, DesiredAccess, ObjectAttributes); _____ Modified: trunk/reactos/ntoskrnl/ob/handle.c --- trunk/reactos/ntoskrnl/ob/handle.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/handle.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -287,7 +287,7 @@ HANDLE TargetHandle; NTSTATUS Status; - ASSERT_IRQL(PASSIVE_LEVEL); + PAGED_CODE(); Status = ObReferenceObjectByHandle(SourceProcessHandle, PROCESS_DUP_HANDLE, @@ -552,6 +552,8 @@ PHANDLE_TABLE HandleTable; POBJECT_HEADER Header; HANDLE_BLOCK *Block; + + PAGED_CODE(); DPRINT("ObDeleteHandle(Handle %x)\n",Handle); @@ -630,6 +632,8 @@ HANDLE_BLOCK* new_blk = NULL; PHANDLE_TABLE HandleTable; KIRQL oldlvl; + + PAGED_CODE(); DPRINT("ObCreateHandle(Process %x, obj %x)\n",Process,ObjectBody); @@ -723,6 +727,8 @@ PEPROCESS Process; KIRQL oldIrql; PHANDLE_ENTRY HandleEntry; + + PAGED_CODE(); DPRINT("ObQueryObjectAuditingByHandle(Handle %x)\n", Handle); @@ -777,7 +783,7 @@ ULONG Attributes; NTSTATUS Status; - ASSERT_IRQL(PASSIVE_LEVEL); + PAGED_CODE(); DPRINT("ObReferenceObjectByHandle(Handle %x, DesiredAccess %x, " "ObjectType %x, AccessMode %d, Object %x)\n",Handle,DesiredAccess, @@ -930,7 +936,7 @@ POBJECT_HEADER Header; NTSTATUS Status; - ASSERT_IRQL(PASSIVE_LEVEL); + PAGED_CODE(); DPRINT("NtClose(Handle %x)\n",Handle); @@ -966,6 +972,8 @@ { POBJECT_HEADER ObjectHeader; ACCESS_MASK Access; + + PAGED_CODE(); Access = DesiredAccess; ObjectHeader = BODY_TO_HEADER(Object); _____ Modified: trunk/reactos/ntoskrnl/ob/namespc.c --- trunk/reactos/ntoskrnl/ob/namespc.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/namespc.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -55,6 +55,8 @@ UNICODE_STRING RemainingPath; OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status; + + PAGED_CODE(); InitializeObjectAttributes(&ObjectAttributes, ObjectPath, @@ -126,6 +128,8 @@ UNICODE_STRING RemainingPath; PVOID Object = NULL; NTSTATUS Status; + + PAGED_CODE(); DPRINT("ObOpenObjectByName(...)\n"); _____ Modified: trunk/reactos/ntoskrnl/ob/ntobj.c --- trunk/reactos/ntoskrnl/ob/ntobj.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/ntobj.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -37,6 +37,8 @@ { PVOID Object; NTSTATUS Status; + + PAGED_CODE(); if (ObjectInformationClass != ObjectHandleInformation) return STATUS_INVALID_INFO_CLASS; @@ -88,6 +90,8 @@ ULONG InfoLength; PVOID Object; NTSTATUS Status; + + PAGED_CODE(); Status = ObReferenceObjectByHandle (ObjectHandle, 0, @@ -260,6 +264,8 @@ { PVOID ObjectBody; NTSTATUS Status; + + PAGED_CODE(); Status = ObReferenceObjectByHandle(ObjectHandle, 0, @@ -299,6 +305,8 @@ { PVOID ObjectBody; NTSTATUS Status; + + PAGED_CODE(); Status = ObReferenceObjectByHandle(ObjectHandle, 0, _____ Modified: trunk/reactos/ntoskrnl/ob/object.c --- trunk/reactos/ntoskrnl/ob/object.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/object.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -346,6 +346,8 @@ UNICODE_STRING PathString; ULONG Attributes; PUNICODE_STRING ObjectName; + + PAGED_CODE(); DPRINT("ObFindObject(ObjectAttributes %x, ReturnedObject %x, " "RemainingPath %x)\n",ObjectAttributes,ReturnedObject,RemainingPath); @@ -483,6 +485,8 @@ POBJECT_HEADER ObjectHeader; ULONG LocalReturnLength; NTSTATUS Status; + + PAGED_CODE(); *ReturnLength = 0; @@ -611,7 +615,7 @@ PSECURITY_DESCRIPTOR NewSecurityDescriptor = NULL; SECURITY_SUBJECT_CONTEXT SubjectContext; - ASSERT_IRQL(APC_LEVEL); + PAGED_CODE(); if(ObjectAttributesAccessMode == UserMode && ObjectAttributes != NULL) { @@ -814,6 +818,8 @@ IN KPROCESSOR_MODE AccessMode) { POBJECT_HEADER Header; + + /* NOTE: should be possible to reference an object above APC_LEVEL! */ DPRINT("ObReferenceObjectByPointer(Object %x, ObjectType %x)\n", Object,ObjectType); @@ -876,6 +882,8 @@ { NTSTATUS Status; + PAGED_CODE(); + DPRINT("ObOpenObjectByPointer()\n"); Status = ObReferenceObjectByPointer(Object, @@ -1117,6 +1125,8 @@ ObGetObjectPointerCount(PVOID Object) { POBJECT_HEADER Header; + + PAGED_CODE(); ASSERT(Object); Header = BODY_TO_HEADER(Object); @@ -1142,6 +1152,8 @@ ObGetObjectHandleCount(PVOID Object) { POBJECT_HEADER Header; + + PAGED_CODE(); ASSERT(Object); Header = BODY_TO_HEADER(Object); _____ Modified: trunk/reactos/ntoskrnl/ob/security.c --- trunk/reactos/ntoskrnl/ob/security.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/security.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -1,4 +1,4 @@ -/* $Id:$ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -27,6 +27,8 @@ { PSECURITY_DESCRIPTOR NewDescriptor; NTSTATUS Status; + + PAGED_CODE(); /* Build the new security descriptor */ Status = SeAssignSecurity(SecurityDescriptor, @@ -73,6 +75,8 @@ POBJECT_HEADER Header; ULONG Length; NTSTATUS Status; + + PAGED_CODE(); Header = BODY_TO_HEADER(Object); if (Header->ObjectType == NULL) @@ -129,6 +133,8 @@ ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN BOOLEAN MemoryAllocated) { + PAGED_CODE(); + if (SecurityDescriptor == NULL) return; @@ -156,6 +162,8 @@ POBJECT_HEADER Header; PVOID Object; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtQuerySecurityObject() called\n"); @@ -226,6 +234,8 @@ ULONG Control = 0; ULONG_PTR Current; NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtSetSecurityObject() called\n"); _____ Modified: trunk/reactos/ntoskrnl/ob/symlink.c --- trunk/reactos/ntoskrnl/ob/symlink.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/ob/symlink.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -206,61 +206,104 @@ IN POBJECT_ATTRIBUTES ObjectAttributes, IN PUNICODE_STRING LinkTarget) { + HANDLE hLink; PSYMLINK_OBJECT SymbolicLink; - NTSTATUS Status; + UNICODE_STRING CapturedLinkTarget; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; - ASSERT_IRQL(PASSIVE_LEVEL); + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); + if(PreviousMode != KernelMode) + { + _SEH_TRY + { + ProbeForWrite(LinkHandle, + sizeof(HANDLE), + sizeof(ULONG)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(!NT_SUCCESS(Status)) + { + return Status; + } + } + + Status = RtlCaptureUnicodeString(&CapturedLinkTarget, + PreviousMode, + PagedPool, + FALSE, + LinkTarget); + if(!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateSymbolicLinkObject: Capturing the target link failed!\n"); + return Status; + } + DPRINT("NtCreateSymbolicLinkObject(LinkHandle %p, DesiredAccess %ul, ObjectAttributes %p, LinkTarget %wZ)\n", LinkHandle, DesiredAccess, ObjectAttributes, - LinkTarget); + &CapturedLinkTarget); Status = ObCreateObject(ExGetPreviousMode(), ObSymbolicLinkType, ObjectAttributes, - ExGetPreviousMode(), + PreviousMode, NULL, sizeof(SYMLINK_OBJECT), 0, 0, (PVOID*)&SymbolicLink); - if (!NT_SUCCESS(Status)) - { - return(Status); - } + if (NT_SUCCESS(Status)) + { + SymbolicLink->TargetName.Length = 0; + SymbolicLink->TargetName.MaximumLength = + ((wcslen(LinkTarget->Buffer) + 1) * sizeof(WCHAR)); + SymbolicLink->TargetName.Buffer = + ExAllocatePoolWithTag(NonPagedPool, + SymbolicLink->TargetName.MaximumLength, + TAG_SYMLINK_TARGET); + RtlCopyUnicodeString(&SymbolicLink->TargetName, + &CapturedLinkTarget); - Status = ObInsertObject ((PVOID)SymbolicLink, - NULL, - DesiredAccess, - 0, - NULL, - LinkHandle); - if (!NT_SUCCESS(Status)) + DPRINT("DeviceName %S\n", SymbolicLink->TargetName.Buffer); + + ZwQuerySystemTime (&SymbolicLink->CreateTime); + + Status = ObInsertObject ((PVOID)SymbolicLink, + NULL, + DesiredAccess, + 0, + NULL, + &hLink); + if (NT_SUCCESS(Status)) { - ObDereferenceObject (SymbolicLink); - return Status; + _SEH_TRY + { + *LinkHandle = hLink; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; } + ObDereferenceObject(SymbolicLink); + } + + RtlReleaseCapturedUnicodeString(&CapturedLinkTarget, + PreviousMode, + FALSE); - SymbolicLink->TargetName.Length = 0; - SymbolicLink->TargetName.MaximumLength = - ((wcslen(LinkTarget->Buffer) + 1) * sizeof(WCHAR)); - SymbolicLink->TargetName.Buffer = - ExAllocatePoolWithTag(NonPagedPool, - SymbolicLink->TargetName.MaximumLength, - TAG_SYMLINK_TARGET); - RtlCopyUnicodeString(&SymbolicLink->TargetName, - LinkTarget); - - DPRINT("DeviceName %S\n", SymbolicLink->TargetName.Buffer); - - ZwQuerySystemTime (&SymbolicLink->CreateTime); - - DPRINT("%s() = STATUS_SUCCESS\n",__FUNCTION__); - ObDereferenceObject(SymbolicLink); - - return(STATUS_SUCCESS); + return Status; } @@ -282,16 +325,58 @@ IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes) { + HANDLE hLink; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); + + if(PreviousMode != KernelMode) + { + _SEH_TRY + { + ProbeForWrite(LinkHandle, + sizeof(HANDLE), + sizeof(ULONG)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(!NT_SUCCESS(Status)) + { + return Status; + } + } + DPRINT("NtOpenSymbolicLinkObject (Name %wZ)\n", ObjectAttributes->ObjectName); - return(ObOpenObjectByName(ObjectAttributes, - ObSymbolicLinkType, - NULL, - (KPROCESSOR_MODE)KeGetPreviousMode(), - DesiredAccess, - NULL, - LinkHandle)); + Status = ObOpenObjectByName(ObjectAttributes, + ObSymbolicLinkType, + NULL, + PreviousMode, + DesiredAccess, + NULL, + &hLink); + if(NT_SUCCESS(Status)) + { + _SEH_TRY + { + *LinkHandle = hLink; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + } + + return Status; } @@ -313,38 +398,93 @@ OUT PUNICODE_STRING LinkTarget, OUT PULONG ResultLength OPTIONAL) { + UNICODE_STRING SafeLinkTarget; PSYMLINK_OBJECT SymlinkObject; - NTSTATUS Status; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; + + PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); + + if(PreviousMode != KernelMode) + { + _SEH_TRY + { + /* probe the unicode string and buffers supplied */ + ProbeForWrite(LinkTarget, + sizeof(UNICODE_STRING), + sizeof(ULONG)); + SafeLinkTarget = *LinkTarget; + ProbeForWrite(SafeLinkTarget.Buffer, + SafeLinkTarget.MaximumLength, + sizeof(WCHAR)); + if(ResultLength != NULL) + { + ProbeForWrite(ResultLength, + sizeof(ULONG), + sizeof(ULONG)); + } + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(!NT_SUCCESS(Status)) + { + return Status; + } + } + else + { + SafeLinkTarget = *LinkTarget; + } + Status = ObReferenceObjectByHandle(LinkHandle, SYMBOLIC_LINK_QUERY, ObSymbolicLinkType, - (KPROCESSOR_MODE)KeGetPreviousMode(), + PreviousMode, (PVOID *)&SymlinkObject, NULL); - if (!NT_SUCCESS(Status)) + if (NT_SUCCESS(Status)) + { + ULONG LengthRequired = SymlinkObject->TargetName.Length + sizeof(WCHAR); + + _SEH_TRY { - return Status; + if(SafeLinkTarget.MaximumLength >= LengthRequired) + { + /* don't pass TargetLink to RtlCopyUnicodeString here because the caller + might have modified the structure which could lead to a copy into + kernel memory! */ + RtlCopyUnicodeString(&SafeLinkTarget, + &SymlinkObject->TargetName); + SafeLinkTarget.Buffer[SafeLinkTarget.Length / sizeof(WCHAR)] = L'\0'; + /* copy back the new UNICODE_STRING structure */ + *LinkTarget = SafeLinkTarget; + } + else + { + Status = STATUS_BUFFER_TOO_SMALL; + } + + if(ResultLength != NULL) + { + *ResultLength = LengthRequired; + } } - - if (ResultLength != NULL) + _SEH_HANDLE { - *ResultLength = (ULONG)SymlinkObject->TargetName.Length + sizeof(WCHAR); + Status = _SEH_GetExceptionCode(); } + _SEH_END; - if (LinkTarget->MaximumLength >= SymlinkObject->TargetName.Length + sizeof(WCHAR)) - { - RtlCopyUnicodeString(LinkTarget, - &SymlinkObject->TargetName); - Status = STATUS_SUCCESS; - } - else - { - Status = STATUS_BUFFER_TOO_SMALL; - } + ObDereferenceObject(SymlinkObject); + } - ObDereferenceObject(SymlinkObject); - return Status; } _____ Modified: trunk/reactos/ntoskrnl/po/power.c --- trunk/reactos/ntoskrnl/po/power.c 2005-02-22 20:08:06 UTC (rev 13717) +++ trunk/reactos/ntoskrnl/po/power.c 2005-02-22 21:09:54 UTC (rev 13718) @@ -91,6 +91,8 @@ IN POWER_STATE State) { POWER_STATE ps; + + ASSERT_IRQL(DISPATCH_LEVEL); ps.SystemState = PowerSystemWorking; // Fully on ps.DeviceState = PowerDeviceD0; // Fully on @@ -228,6 +230,8 @@ ) { NTSTATUS Status; + + PAGED_CODE(); DPRINT("NtPowerInformation(PowerInformationLevel 0x%x, InputBuffer 0x%x, " "InputBufferLength 0x%x, OutputBuffer 0x%x, OutputBufferLength 0x%x)\n",
19 years, 10 months
1
0
0
0
[weiden] 13717: German translation of winecalc by Rouven Wessling
by weiden@svn.reactos.com
German translation of winecalc by Rouven Wessling Added: trunk/reactos/subsys/system/calc/De.rc Modified: trunk/reactos/subsys/system/calc/calc.rc _____ Added: trunk/reactos/subsys/system/calc/De.rc --- trunk/reactos/subsys/system/calc/De.rc 2005-02-22 19:59:12 UTC (rev 13716) +++ trunk/reactos/subsys/system/calc/De.rc 2005-02-22 20:08:06 UTC (rev 13717) @@ -0,0 +1,155 @@ +/* + * WineCalc (DE.rc) + * + * Copyright 2005 Rouven Wessling + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "windows.h" +#include "resource.h" +#include "winecalc.h" + +LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +{ + IDS_APPNAME, "Rechner" + + IDS_COPYRIGHT1, "Calculator 5.0. Lizensiert unter der LGPL 2" + IDS_COPYRIGHT2 "Copyright 2003, James Briggs" + IDS_COPYRIGHT3 "San Jose, California, USA" + IDS_COPYRIGHT4 "james(a)ActionMessage.com" + IDS_COPYRIGHT5 "
http://www.ActionMessage.com/winecalc/
" + + IDS_BTN_BACKSPACE, "R³cktaste" + IDS_BTN_CLEAR_ENTRY, "CE" + IDS_BTN_CLEAR_ALL, "C" + IDS_BTN_MEM_CLEAR, "MC" + IDS_BTN_MEM_RECALL, "MR" + IDS_BTN_MEM_STORE, "MS" + IDS_BTN_MEM_PLUS, "M+" + IDS_BTN_MEM_STATUS_M, "M" + IDS_BTN_SQRT, "sqrt" + IDS_ERR_INVALID_INPUT, "Ung³ltige Eingabe f³r funktion." + IDS_ERR_DIVIDE_BY_ZERO, "Teilen durch 0 unm÷glich." + IDS_ERR_UNDEFINED, "Das Ergebnis der funktion is undefiniert." +} + +MAIN_MENU MENU DISCARDABLE +{ + POPUP "&Bearbeiten" { + MENUITEM "&Kopieren Ctrl+C", IDM_COPY + MENUITEM "&Einf³gen Ctrl+V", IDM_PASTE + } + POPUP "&Ansicht" { + MENUITEM "&Standard", IDM_MODE_STANDARD + MENUITEM "&Wissenschaftlich", IDM_MODE_SCIENTIFIC + MENUITEM SEPARATOR + MENUITEM "&Zifferngruppierung", IDM_DIGIT_GROUPING + } + POPUP "&?" { + MENUITEM "&Hilfethemen", IDM_HELP_TOPICS + MENUITEM SEPARATOR + MENUITEM "&Info", IDM_ABOUT + } +} + +SCIMS_MENU MENU DISCARDABLE +{ + POPUP "&Bearbeiten" { + MENUITEM "&Kopiren Ctrl+C", IDM_COPY + MENUITEM "&Einf³gen Ctrl+V", IDM_PASTE + } + POPUP "&Anzeige" { + MENUITEM "&Standard", IDM_MODE_STANDARD + MENUITEM "&Wissenschaftlich", IDM_MODE_SCIENTIFIC + MENUITEM SEPARATOR + MENUITEM "&Hex\tF5", ID_CALC_NS_HEX + MENUITEM "De&zimal\tF6", ID_CALC_NS_DEC + MENUITEM "O&ktal\tF7", ID_CALC_NS_OCT + MENUITEM "&Binõr\tF8", ID_CALC_NS_BIN + MENUITEM SEPARATOR + MENUITEM "&Deg\tF2", ID_CALC_MS_DEGREES + MENUITEM "&Rad\tF3", ID_CALC_MS_RADIANS + MENUITEM "&Grad\tF4", ID_CALC_MS_GRADS + MENUITEM SEPARATOR + MENUITEM "Zifferngr&uppierung", IDM_DIGIT_GROUPING + } + POPUP "&?" { + MENUITEM "&Hilfethemen", IDM_HELP_TOPICS + MENUITEM SEPARATOR + MENUITEM "&Info", IDM_ABOUT + } +} + +SCIWS_MENU MENU DISCARDABLE +{ + POPUP "&Bearbeiten" { + MENUITEM "&Kopieren Ctrl+C", IDM_COPY + MENUITEM "&Einf³gen Ctrl+V", IDM_PASTE + } + POPUP "&Anzeige" { + MENUITEM "&Standard", IDM_MODE_STANDARD + MENUITEM "&Wissenschaftlich", IDM_MODE_SCIENTIFIC + MENUITEM SEPARATOR + MENUITEM "&Hex\tF5", ID_CALC_NS_HEX + MENUITEM "De&zimal\tF6", ID_CALC_NS_DEC + MENUITEM "O&ktal\tF7", ID_CALC_NS_OCT + MENUITEM "&Binõr\tF8", ID_CALC_NS_BIN + MENUITEM SEPARATOR + MENUITEM "&Qword\tF12", ID_CALC_WS_QWORD + MENUITEM "Dw&ord\tF2", ID_CALC_WS_DWORD + MENUITEM "Wo&rd\tF3", ID_CALC_WS_WORD + MENUITEM "&Byte\tF4", ID_CALC_WS_BYTE + MENUITEM SEPARATOR + MENUITEM "&Zifferngruppierung", IDM_DIGIT_GROUPING + } + POPUP "&?" { + MENUITEM "&Hilfethemen", IDM_HELP_TOPICS + MENUITEM SEPARATOR + MENUITEM "&Info", IDM_ABOUT + } +} + +MAIN_MENU ACCELERATORS +BEGIN + VK_F1, IDV_HELP, VIRTKEY +END + +DLG_ABOUT DIALOG 12,0,120,82 +CAPTION "Info ³ber GNU winecalc" +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +BEGIN + DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +WHATS_THIS_MENU MENU DISCARDABLE +{ + POPUP "" { + MENUITEM "Was ist das?", IDM_WHATS_THIS + } +} + +DLG_STATS DIALOG 12,0,125,78 +CAPTION "Statistics Box" +FONT 9, "Tahoma" +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +BEGIN + DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP + PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP + PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP + PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP +END _____ Modified: trunk/reactos/subsys/system/calc/calc.rc --- trunk/reactos/subsys/system/calc/calc.rc 2005-02-22 19:59:12 UTC (rev 13716) +++ trunk/reactos/subsys/system/calc/calc.rc 2005-02-22 20:08:06 UTC (rev 13717) @@ -4,3 +4,5 @@ #include <reactos/resource.h> #include "rsrc.rc" +#include "De.rc" +
19 years, 10 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
42
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Results per page:
10
25
50
100
200