From ec6809fa4ffe7932086f262571eb80507fa17f2b Mon Sep 17 00:00:00 2001 From: wj32 Date: Sun, 15 Aug 2010 01:43:47 +0000 Subject: [PATCH] changed PhExpandEnvironmentStrings argument to a PH_STRINGREF git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3499 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- 2.x/trunk/ProcessHacker/appsup.c | 2 +- 2.x/trunk/ProcessHacker/srvprp.c | 2 +- 2.x/trunk/phlib/include/ph.h | 2 +- 2.x/trunk/phlib/support.c | 11 ++++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/2.x/trunk/ProcessHacker/appsup.c b/2.x/trunk/ProcessHacker/appsup.c index beaf7dbe2..6a64977d0 100644 --- a/2.x/trunk/ProcessHacker/appsup.c +++ b/2.x/trunk/ProcessHacker/appsup.c @@ -334,7 +334,7 @@ BOOLEAN PhaGetProcessKnownCommandLine( PHA_DEREFERENCE(PhQueryRegistryString(inprocServer32KeyHandle, NULL)); if (fileName = PHA_DEREFERENCE(PhExpandEnvironmentStrings( - KnownCommandLine->ComSurrogate.FileName->Buffer + &KnownCommandLine->ComSurrogate.FileName->sr ))) { KnownCommandLine->ComSurrogate.FileName = fileName; diff --git a/2.x/trunk/ProcessHacker/srvprp.c b/2.x/trunk/ProcessHacker/srvprp.c index 6f735c334..92385449d 100644 --- a/2.x/trunk/ProcessHacker/srvprp.c +++ b/2.x/trunk/ProcessHacker/srvprp.c @@ -235,7 +235,7 @@ INT_PTR CALLBACK PhpServiceGeneralDlgProc( { PPH_STRING expandedString; - if (expandedString = PhExpandEnvironmentStrings(serviceDllString->Buffer)) + if (expandedString = PhExpandEnvironmentStrings(&serviceDllString->sr)) { SetDlgItemText(hwndDlg, IDC_SERVICEDLL, expandedString->Buffer); PhDereferenceObject(expandedString); diff --git a/2.x/trunk/phlib/include/ph.h b/2.x/trunk/phlib/include/ph.h index 4ebd290aa..455114aaa 100644 --- a/2.x/trunk/phlib/include/ph.h +++ b/2.x/trunk/phlib/include/ph.h @@ -2318,7 +2318,7 @@ PPH_STRING PhGetFullPath( PHLIBAPI PPH_STRING PhExpandEnvironmentStrings( - __in PWSTR String + __in PPH_STRINGREF String ); PHLIBAPI diff --git a/2.x/trunk/phlib/support.c b/2.x/trunk/phlib/support.c index c00ed8577..007f91d6e 100644 --- a/2.x/trunk/phlib/support.c +++ b/2.x/trunk/phlib/support.c @@ -1475,24 +1475,21 @@ PPH_STRING PhGetFullPath( } PPH_STRING PhExpandEnvironmentStrings( - __in PWSTR String + __in PPH_STRINGREF String ) { NTSTATUS status; PPH_STRING string; - UNICODE_STRING sourceString; ULONG bufferLength; - RtlInitUnicodeString(&sourceString, String); - bufferLength = 0x40; string = PhCreateStringEx(NULL, bufferLength); string->us.Length = 0; status = RtlExpandEnvironmentStrings_U( NULL, - &sourceString, - &string->us, + &String->us, + &string->us, &bufferLength ); @@ -1504,7 +1501,7 @@ PPH_STRING PhExpandEnvironmentStrings( status = RtlExpandEnvironmentStrings_U( NULL, - &sourceString, + &String->us, &string->us, &bufferLength );