2010-05-21 08:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbwin/win_svc.c
    + WIN_SERVICEINSTALL(): Extended to accept 3rd parameter
      for the full filename of the service executable. This
      makes it possible to install other .exes not just self.
This commit is contained in:
Viktor Szakats
2010-05-21 06:52:49 +00:00
parent b669a223c9
commit 55af9daf4b
2 changed files with 24 additions and 5 deletions

View File

@@ -17,6 +17,12 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-05-21 08:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/win_svc.c
+ WIN_SERVICEINSTALL(): Extended to accept 3rd parameter
for the full filename of the service executable. This
makes it possible to install other .exes not just self.
2010-05-20 16:49 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/generator/hbqtgen.prg
! Two small fixes. No code regeneration required.

View File

@@ -185,10 +185,23 @@ HB_FUNC( WIN_SERVICESTOP )
HB_FUNC( WIN_SERVICEINSTALL )
{
HB_BOOL bRetVal = HB_FALSE;
#if ! defined( HB_OS_WIN_CE )
TCHAR lpPath[ MAX_PATH ];
if( GetModuleFileName( NULL, lpPath, HB_SIZEOFARRAY( lpPath ) ) )
#if ! defined( HB_OS_WIN_CE )
void * hPath;
LPCTSTR lpPath = HB_PARSTR( 3, &hPath, NULL );
TCHAR lpPathBuffer[ MAX_PATH ];
if( lpPath == NULL )
{
if( GetModuleFileName( NULL, lpPathBuffer, HB_SIZEOFARRAY( lpPathBuffer ) ) )
lpPath = lpPathBuffer;
else
hbwapi_SetLastError( GetLastError() );
}
if( lpPath )
{
SC_HANDLE schSCM = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
@@ -233,8 +246,8 @@ HB_FUNC( WIN_SERVICEINSTALL )
else
hbwapi_SetLastError( GetLastError() );
}
else
hbwapi_SetLastError( GetLastError() );
hb_strfree( hPath );
#endif
hb_retl( bRetVal );