Author: mjmartin
Date: Mon Jun 1 21:11:30 2009
New Revision: 41236
URL:
http://svn.reactos.org/svn/reactos?rev=41236&view=rev
Log:
eventlog.c: When manually creating RPC_UNICODE_STRING/RPC_STRING the Length member does
not include the terminating null, but MaximumLength does. Fixes returning handle for
Security and System event logs.
Modified:
trunk/reactos/dll/win32/advapi32/service/eventlog.c
Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] Mon Jun 1 21:11:30
2009
@@ -154,6 +154,7 @@
BackupFileName.Buffer = (LPSTR)lpBackupFileName;
BackupFileName.Length = BackupFileName.MaximumLength =
lpBackupFileName ? strlen(lpBackupFileName) : 0;
+ BackupFileName.MaximumLength += sizeof(CHAR);
RpcTryExcept
{
@@ -194,6 +195,7 @@
BackupFileName.Buffer = (LPWSTR)lpBackupFileName;
BackupFileName.Length = BackupFileName.MaximumLength =
lpBackupFileName ? wcslen(lpBackupFileName) * sizeof(WCHAR) : 0;
+ BackupFileName.MaximumLength += sizeof(WCHAR);
RpcTryExcept
{
@@ -231,6 +233,7 @@
BackupFileName.Buffer = (LPSTR)lpBackupFileName;
BackupFileName.Length = BackupFileName.MaximumLength =
lpBackupFileName ? strlen(lpBackupFileName) : 0;
+ BackupFileName.MaximumLength += sizeof(CHAR);
RpcTryExcept
{
@@ -268,6 +271,7 @@
BackupFileName.Buffer = (LPWSTR)lpBackupFileName;
BackupFileName.Length = BackupFileName.MaximumLength =
lpBackupFileName ? wcslen(lpBackupFileName) * sizeof(WCHAR) : 0;
+ BackupFileName.MaximumLength += sizeof(WCHAR);
RpcTryExcept
{
@@ -508,6 +512,7 @@
FileName.Buffer = (LPWSTR)lpFileName;
FileName.Length = FileName.MaximumLength =
lpFileName ? wcslen(lpFileName) * sizeof(WCHAR) : 0;
+ FileName.MaximumLength += sizeof(WCHAR);
RpcTryExcept
{
@@ -587,6 +592,7 @@
SourceName.Buffer = (LPWSTR)lpSourceName;
SourceName.Length = SourceName.MaximumLength =
lpSourceName ? wcslen(lpSourceName) * sizeof(WCHAR) : 0;
+ SourceName.MaximumLength += sizeof(WCHAR);
RpcTryExcept
{
@@ -793,6 +799,7 @@
SourceName.Buffer = (LPWSTR)lpSourceName;
SourceName.Length = SourceName.MaximumLength =
lpSourceName ? wcslen(lpSourceName) * sizeof(WCHAR) : 0;
+ SourceName.MaximumLength += sizeof(WCHAR);
RpcTryExcept
{