Modified:
/trunk/Win32-Daemon/Daemon.xs
/trunk/Win32-Daemon/ServiceThread.cpp
/trunk/Win32-Daemon/constant.cpp
/trunk/Win32-Daemon/constant.h
/trunk/Win32-Daemon/xs_win32perl.h
=======================================
--- /trunk/Win32-Daemon/Daemon.xs Mon Jan 17 15:21:10 2011
+++ /trunk/Win32-Daemon/Daemon.xs Mon Jan 17 16:12:27 2011
@@ -238,7 +238,7 @@
// privilege, and a flag to either enable/disable that privilege. The
// function will attempt to perform the desired action upon the token
// returning TRUE if it succeeded, or FALSE if it failed.
-BOOL SetPrivilege( HANDLE hToken, LPTSTR pszPrivilege, BOOL bSetFlag )
+BOOL SetPrivilege( HANDLE hToken, const char *pszPrivilege, BOOL bSetFlag )
{
TOKEN_PRIVILEGES structPriv, structPrevPriv;
LUID Luid;
@@ -1481,16 +1481,16 @@
TCHAR szBuffer[ MAX_PATH * 2 ];
TCHAR szBinaryPath[ MAX_PATH ];
TCHAR szDependencies[ MAX_SERVICE_DEPENDENCY_BUFFER_SIZE ];
- LPTSTR pszDepend = szDependencies;
- LPTSTR pszMachine = HASH_GET_PV( pHv, KEYWORD_SERVICE_MACHINE );
- LPTSTR pszServiceName = HASH_GET_PV( pHv, KEYWORD_SERVICE_NAME );
- LPTSTR pszDisplayName = HASH_GET_PV( pHv, KEYWORD_SERVICE_DISPLAY_NAME
);
- LPTSTR pszUser = HASH_GET_PV( pHv, KEYWORD_SERVICE_ACCOUNT_UID );
- LPTSTR pszPwd = HASH_GET_PV( pHv, KEYWORD_SERVICE_ACCOUNT_PWD );
- LPTSTR pszBinaryPath = HASH_GET_PV( pHv, KEYWORD_SERVICE_BINARY_PATH );
- LPTSTR pszParameters = HASH_GET_PV( pHv, KEYWORD_SERVICE_PARAMETERS );
- LPTSTR pszDescription = HASH_GET_PV( pHv, KEYWORD_SERVICE_DESCRIPTION );
- LPTSTR pszLoadOrder = NULL;
+ const char *pszDepend = szDependencies;
+ const char *pszMachine = HASH_GET_PV( pHv, KEYWORD_SERVICE_MACHINE
);
+ const char *pszServiceName = HASH_GET_PV( pHv, KEYWORD_SERVICE_NAME );
+ const char *pszDisplayName = HASH_GET_PV( pHv,
KEYWORD_SERVICE_DISPLAY_NAME );
+ const char *pszUser = HASH_GET_PV( pHv,
KEYWORD_SERVICE_ACCOUNT_UID );
+ const char *pszPwd = HASH_GET_PV( pHv,
KEYWORD_SERVICE_ACCOUNT_PWD );
+ const char *pszBinaryPath = HASH_GET_PV( pHv,
KEYWORD_SERVICE_BINARY_PATH );
+ const char *pszParameters = HASH_GET_PV( pHv,
KEYWORD_SERVICE_PARAMETERS );
+ const char *pszDescription = HASH_GET_PV( pHv,
KEYWORD_SERVICE_DESCRIPTION );
+ const char *pszLoadOrder = NULL;
DWORD dwTag = 0;
DWORD dwAccess = SERVICE_ALL_ACCESS;
DWORD dwServiceType = SERVICE_WIN32_OWN_PROCESS;
@@ -1598,8 +1598,8 @@
PREINIT:
HV *pHv = NULL;
BOOL fResult = FALSE;
- LPTSTR pszServiceName = NULL;
- LPTSTR pszMachine = TEXT( "" );
+ const char *pszServiceName = NULL;
+ const char *pszMachine = TEXT( "" );
DWORD dwIndex = 0;
CODE:
@@ -1663,16 +1663,16 @@
TCHAR szBuffer[ MAX_PATH * 2 ];
TCHAR szBinaryPath[ MAX_PATH ];
TCHAR szDependencies[ MAX_SERVICE_DEPENDENCY_BUFFER_SIZE ];
- LPTSTR pszMachine = HASH_GET_PV( pHv, KEYWORD_SERVICE_MACHINE );
- LPTSTR pszServiceName = NULL;
- LPTSTR pszDisplayName = NULL;
- LPTSTR pszUser = NULL;
- LPTSTR pszPwd = NULL;
- LPTSTR pszBinaryPath = NULL;
- LPTSTR pszParameters = NULL;
- LPTSTR pszLoadOrder = NULL;
- LPTSTR pszDepend = NULL;
- LPTSTR pszDescription = NULL;
+ const char *pszMachine = HASH_GET_PV( pHv, KEYWORD_SERVICE_MACHINE );
+ const char *pszServiceName = NULL;
+ const char *pszDisplayName = NULL;
+ const char *pszUser = NULL;
+ const char *pszPwd = NULL;
+ const char *pszBinaryPath = NULL;
+ const char *pszParameters = NULL;
+ const char *pszLoadOrder = NULL;
+ const char *pszDepend = NULL;
+ const char *pszDescription = NULL;
DWORD dwTagId = 0;
DWORD *pdwTagId = NULL;
DWORD dwAccess = SERVICE_ALL_ACCESS;
@@ -1760,7 +1760,8 @@
AV *pAv = NULL;
if( NULL != ( pAv = HASH_GET_AV( pHv, KEYWORD_SERVICE_DEPENDENCIES ) )
)
{
- LPTSTR pszBuffer = pszDepend = szDependencies;
+ LPTSTR pszBuffer = szDependencies;
+ pszDepend = szDependencies;
// av_len() returns -1 if no entries. Otherwise it returns the
// largest index number in the array.
DWORD dwCount = av_len( pAv ) + 1;
@@ -1860,8 +1861,8 @@
{
TCHAR szServiceName[ 256 ];
TCHAR szMachineName[ 256 ];
- LPTSTR pszServiceName = HASH_GET_PV( pHv, KEYWORD_SERVICE_NAME );
- LPTSTR pszMachineName = HASH_GET_PV( pHv, KEYWORD_SERVICE_MACHINE );
+ const char *pszServiceName = HASH_GET_PV( pHv, KEYWORD_SERVICE_NAME );
+ const char *pszMachineName = HASH_GET_PV( pHv, KEYWORD_SERVICE_MACHINE
);
// Copy the service name to a local buffer so we can clear out the
// hash...
@@ -2123,11 +2124,11 @@
BOOL
ShowService( pszWindowStation = TEXT( "Winsta0" ), ... )
- LPTSTR pszWindowStation
+ const char *pszWindowStation
PREINIT:
BOOL fResult;
- LPTSTR pszDesktop = TEXT( "Default" );
+ const char *pszDesktop = TEXT( "Default" );
CODE:
{
@@ -2529,7 +2530,7 @@
-LPTSTR
+const char *
DebugOutputPath( ... )
CODE:
=======================================
--- /trunk/Win32-Daemon/ServiceThread.cpp Sun Nov 29 16:54:20 2009
+++ /trunk/Win32-Daemon/ServiceThread.cpp Mon Jan 17 16:12:27 2011
@@ -192,7 +192,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID WINAPI ServiceHandler( DWORD dwControl )
{
- LPTSTR pszCommand = SERVICE_CONTROL_STRING_EMPTY;
+ const char *pszCommand = SERVICE_CONTROL_STRING_EMPTY;
DWORD dwState = gdwState;
BOOL fUseTimer = FALSE;
#ifdef _DEBUG
=======================================
--- /trunk/Win32-Daemon/constant.cpp Sun Nov 29 01:00:41 2009
+++ /trunk/Win32-Daemon/constant.cpp Mon Jan 17 16:12:27 2011
@@ -186,9 +186,9 @@
return( eResult );
}
-LPTSTR GetConstantName( DWORD dwIndex )
-{
- LPTSTR pszBuffer = NULL;
+const char *GetConstantName( DWORD dwIndex )
+{
+ const char *pszBuffer = NULL;
if( gdwConstTotal > dwIndex )
{
pszBuffer = gsConst[ dwIndex ].m_Name;
=======================================
--- /trunk/Win32-Daemon/constant.h Sun Nov 29 16:54:20 2009
+++ /trunk/Win32-Daemon/constant.h Mon Jan 17 16:12:27 2011
@@ -81,13 +81,13 @@
#define DEFAULT_CALLBACK_TIMER 5000
eConstantType Constant( LPTSTR pszConstant, LPVOID *ppBuffer );
-LPTSTR GetConstantName( DWORD dwIndex );
+const char *GetConstantName( DWORD dwIndex );
DWORD GetTotalConstants();
void CountConstants();
typedef struct tagConstStruct
{
- LPTSTR m_Name;
+ const char *m_Name;
LPVOID m_pBuffer;
eConstantType m_eType;
} ConstantStruct;
@@ -179,7 +179,7 @@
int My_SetServiceBits( SERVICE_STATUS_HANDLE hService, DWORD
dwServiceBits, BOOL bSetBitsOn, BOOL bUpdateImmediately );
BOOL GetProcessSid( HANDLE hProcess, SID *pSid, DWORD dwSidBufferSize );
BOOL GetSidFromToken( HANDLE hToken, SID *pSid, DWORD dwSidBufferSize );
-BOOL SetPrivilege( HANDLE hToken, LPTSTR pszPrivilege, BOOL bSetFlag );
+BOOL SetPrivilege( HANDLE hToken, const char *pszPrivilege, BOOL bSetFlag
);
void TextFromSid( LPTSTR pszBuffer, SID *pSid );
BOOL LoadProfile( SID *pSid );
BOOL StoreServiceDescription( LPCTSTR pszMachine, LPCTSTR pszServiceName,
LPCTSTR pszDescription );
=======================================
--- /trunk/Win32-Daemon/xs_win32perl.h Sun Nov 29 16:12:39 2009
+++ /trunk/Win32-Daemon/xs_win32perl.h Mon Jan 17 16:12:27 2011
@@ -254,13 +254,13 @@
#define HASH_KEY_EXISTS(x,y) ( 0 != hv_exists( (HV*)(x),
(LPTSTR)(y), _tcslen( (LPTSTR)(y) ) ) )
// Define the inline hash extraction prototypes...
- char *HashGetPV( pTHX_ HV *pHv, LPTSTR pszKeyName );
- IV HashGetIV( pTHX_ HV *pHv, LPTSTR pszKeyName );
- double HashGetNV( pTHX_ HV *pHv, LPTSTR pszKeyName );
- SV *HashGetSV( pTHX_ HV *pHv, LPTSTR pszKeyName );
+ const char *HashGetPV( pTHX_ HV *pHv, const char *pszKeyName );
+ IV HashGetIV( pTHX_ HV *pHv, const char *pszKeyName );
+ double HashGetNV( pTHX_ HV *pHv, const char *pszKeyName );
+ SV *HashGetSV( pTHX_ HV *pHv, const char *pszKeyName );
// Now define the inline functions used by the hash macros
- inline LPTSTR HashGetPV( pTHX_ HV *pHv, LPTSTR pszKeyName )
+ inline const char *HashGetPV( pTHX_ HV *pHv, const char *pszKeyName )
{
SV *pSv = HashGetSV( aTHX_ pHv, pszKeyName );
if( NULL != pSv )
@@ -273,7 +273,7 @@
}
}
- inline IV HashGetIV( pTHX_ HV *pHv, LPTSTR pszKeyName )
+ inline IV HashGetIV( pTHX_ HV *pHv, const char *pszKeyName )
{
SV *pSv = HashGetSV( aTHX_ pHv, pszKeyName );
if( NULL != pSv )
@@ -286,7 +286,7 @@
}
}
- inline double HashGetNV( pTHX_ HV *pHv, LPTSTR pszKeyName )
+ inline double HashGetNV( pTHX_ HV *pHv, const char *pszKeyName )
{
SV *pSv = HashGetSV( aTHX_ pHv, pszKeyName );
if( NULL != pSv )
@@ -299,7 +299,7 @@
}
}
- inline SV * HashGetSV( pTHX_ HV *pHv, LPTSTR pszKeyName )
+ inline SV * HashGetSV( pTHX_ HV *pHv, const char *pszKeyName )
{
SV *pSv = NULL;
if( ( NULL == pszKeyName ) || ( NULL == pHv ) )