Move up SERV_* functions.
This commit is contained in:
parent
2a389a6979
commit
970a877995
|
@ -155,6 +155,43 @@ static void init_service_handle( struct sc_handle* handle,
|
||||||
handle->u.service.sc_manager = sc_manager;
|
handle->u.service.sc_manager = sc_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline LPWSTR SERV_dup( LPCSTR str )
|
||||||
|
{
|
||||||
|
UINT len;
|
||||||
|
LPWSTR wstr;
|
||||||
|
|
||||||
|
if( !str )
|
||||||
|
return NULL;
|
||||||
|
len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
|
||||||
|
wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
|
||||||
|
MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, len );
|
||||||
|
return wstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline LPWSTR SERV_dupmulti( LPCSTR str )
|
||||||
|
{
|
||||||
|
UINT len = 0, n = 0;
|
||||||
|
LPWSTR wstr;
|
||||||
|
|
||||||
|
if( !str )
|
||||||
|
return NULL;
|
||||||
|
do {
|
||||||
|
len += MultiByteToWideChar( CP_ACP, 0, &str[n], -1, NULL, 0 );
|
||||||
|
n += (strlen( &str[n] ) + 1);
|
||||||
|
} while (str[n]);
|
||||||
|
len++;
|
||||||
|
n++;
|
||||||
|
|
||||||
|
wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
|
||||||
|
MultiByteToWideChar( CP_ACP, 0, str, n, wstr, len );
|
||||||
|
return wstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline VOID SERV_free( LPWSTR wstr )
|
||||||
|
{
|
||||||
|
HeapFree( GetProcessHeap(), 0, wstr );
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* EnumServicesStatusA [ADVAPI32.@]
|
* EnumServicesStatusA [ADVAPI32.@]
|
||||||
*/
|
*/
|
||||||
|
@ -760,43 +797,6 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline LPWSTR SERV_dup( LPCSTR str )
|
|
||||||
{
|
|
||||||
UINT len;
|
|
||||||
LPWSTR wstr;
|
|
||||||
|
|
||||||
if( !str )
|
|
||||||
return NULL;
|
|
||||||
len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
|
|
||||||
wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
|
|
||||||
MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, len );
|
|
||||||
return wstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline LPWSTR SERV_dupmulti( LPCSTR str )
|
|
||||||
{
|
|
||||||
UINT len = 0, n = 0;
|
|
||||||
LPWSTR wstr;
|
|
||||||
|
|
||||||
if( !str )
|
|
||||||
return NULL;
|
|
||||||
do {
|
|
||||||
len += MultiByteToWideChar( CP_ACP, 0, &str[n], -1, NULL, 0 );
|
|
||||||
n += (strlen( &str[n] ) + 1);
|
|
||||||
} while (str[n]);
|
|
||||||
len++;
|
|
||||||
n++;
|
|
||||||
|
|
||||||
wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
|
|
||||||
MultiByteToWideChar( CP_ACP, 0, str, n, wstr, len );
|
|
||||||
return wstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline VOID SERV_free( LPWSTR wstr )
|
|
||||||
{
|
|
||||||
HeapFree( GetProcessHeap(), 0, wstr );
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* CreateServiceA [ADVAPI32.@]
|
* CreateServiceA [ADVAPI32.@]
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue