示例#1
0
NS_IMETHODIMP
nsDBFolderInfo::GetLocale(nsAString &result)
{
  GetProperty(kLocaleColumnName, result);
  return NS_OK;
}
示例#2
0
float CMMap::GetFontSize()
{
	float result;
	GetProperty(0x14, VT_R4, (void*)&result);
	return result;
}
示例#3
0
short CMMap::GetFonts()
{
	short result;
	GetProperty(0x16, VT_I2, (void*)&result);
	return result;
}
示例#4
0
long CMMap::GetBevelOuter()
{
	long result;
	GetProperty(0x10, VT_I4, (void*)&result);
	return result;
}
示例#5
0
short CMMap::GetBorderWidth()
{
	short result;
	GetProperty(0x12, VT_I2, (void*)&result);
	return result;
}
示例#6
0
short CMMap::GetCaptions()
{
	short result;
	GetProperty(0xb, VT_I2, (void*)&result);
	return result;
}
示例#7
0
CPictureDisp CMMap::GetBackPicture()
{
	LPDISPATCH pDispatch;
	GetProperty(0xe, VT_DISPATCH, (void*)&pDispatch);
	return CPictureDisp(pDispatch);
}
示例#8
0
BOOL CMMap::GetPanEnabled()
{
	BOOL result;
	GetProperty(0x54, VT_BOOL, (void*)&result);
	return result;
}
示例#9
0
long CMMap::GetCaptionOrientation()
{
	long result;
	GetProperty(0x55, VT_I4, (void*)&result);
	return result;
}
示例#10
0
CPictureDisp CMMap::GetWaypointPicture()
{
	LPDISPATCH pDispatch;
	GetProperty(0x52, VT_DISPATCH, (void*)&pDispatch);
	return CPictureDisp(pDispatch);
}
示例#11
0
CString CMMap::GetCaption()
{
	CString result;
	GetProperty(DISPID_CAPTION, VT_BSTR, (void*)&result);
	return result;
}
示例#12
0
CString CMMap::GetWaypointShape()
{
	CString result;
	GetProperty(0x51, VT_BSTR, (void*)&result);
	return result;
}
示例#13
0
double CMMap::GetWaypointZ()
{
	double result;
	GetProperty(0x50, VT_R8, (void*)&result);
	return result;
}
示例#14
0
UINT CALaunchBOINCManager::OnExecution()
{
    static HMODULE advapi32lib = NULL;
    static tSCREATEL pSCREATEL = NULL;
    static tSCTFL pSCTFL = NULL;
    static tSCLOSEL pSCLOSEL = NULL;
    PROCESS_INFORMATION process_info;
    STARTUPINFO startup_info;
    SAFER_LEVEL_HANDLE hSaferHandle;
    HANDLE hRestrictedToken;
    SID_IDENTIFIER_AUTHORITY siaMLA = SECURITY_MANDATORY_LABEL_AUTHORITY;
    PSID  pSidMedium = NULL;
    TOKEN_MANDATORY_LABEL TIL = {0};
    DWORD dwEnableVirtualization = 1;
    tstring strInstallDirectory;
    tstring strBuffer;
    UINT uiReturnValue = -1;
    FILE* f;

    memset(&process_info, 0, sizeof(process_info));
    memset(&startup_info, 0, sizeof(startup_info));
    startup_info.cb = sizeof(startup_info);
    startup_info.dwFlags = STARTF_USESHOWWINDOW;
    startup_info.wShowWindow = SW_SHOW;

    f = fopen("LaunchManager.txt", "w");

    if (!advapi32lib) {
        advapi32lib = LoadLibraryA("advapi32.dll");
        if (advapi32lib) {
            pSCREATEL = (tSCREATEL)GetProcAddress(advapi32lib, "SaferCreateLevel");
            pSCTFL = (tSCTFL)GetProcAddress(advapi32lib, "SaferComputeTokenFromLevel");
            pSCLOSEL = (tSCLOSEL)GetProcAddress(advapi32lib, "SaferCloseLevel");
        }
    }

    if (!pSCREATEL || !pSCTFL || !pSCLOSEL) {
        return ERROR_FILE_NOT_FOUND;
    }

    uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory );
    if ( uiReturnValue ) return uiReturnValue;


    // Calculate a restricted token from the current token.
    if (!pSCREATEL( SAFER_SCOPEID_USER, SAFER_LEVELID_NORMALUSER, SAFER_LEVEL_OPEN, &hSaferHandle, NULL ))
    {
        fwprintf(f, _T("SaferCreateLevel retval: '%d'\n"), GetLastError());
    }

    if (!pSCTFL( hSaferHandle, NULL, &hRestrictedToken, NULL, NULL ))
    {
        fwprintf(f, _T("SaferComputeTokenFromLevel retval: '%d'\n"), GetLastError());
    }

    AllocateAndInitializeSid(&siaMLA, 1, SECURITY_MANDATORY_MEDIUM_RID, 0, 0, 0, 0, 0, 0, 0, &pSidMedium);

    TIL.Label.Attributes = SE_GROUP_INTEGRITY;
    TIL.Label.Sid        = pSidMedium;

    if (!SetTokenInformation(hRestrictedToken, (TOKEN_INFORMATION_CLASS)TokenIntegrityLevel, &TIL, sizeof(TOKEN_MANDATORY_LABEL)))
    {
        fwprintf(f, _T("SaferComputeTokenFromLevel (TokenIntegrityLevel) retval: '%d'\n"), GetLastError());
    }

    if (!SetTokenInformation(hRestrictedToken, (TOKEN_INFORMATION_CLASS)TokenVirtualizationEnabled, &dwEnableVirtualization, sizeof(DWORD)))
    {
        fwprintf(f, _T("SaferComputeTokenFromLevel (TokenVirtualizationEnabled) retval: '%d'\n"), GetLastError());
    }


    strBuffer = tstring(_T("\"")) + strInstallDirectory + tstring(_T("boincmgr.exe\""));
    fwprintf(f, _T("Attempting to launch boincmgr.exe\n"));
    fwprintf(f, _T("Launching: '%s'\n"), strBuffer.c_str());
    if (CreateProcessAsUser( hRestrictedToken, NULL, (LPWSTR)strBuffer.c_str(), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup_info, &process_info ))
    {
        fwprintf(f, _T("Success!!!\n"));
        CloseHandle( process_info.hProcess );
        CloseHandle( process_info.hThread );
    }
    else
    {
        fwprintf(f, _T("CreateProcessAsUser retval: '%d'\n"), GetLastError());
    }

    strBuffer = tstring(_T("\"")) + strInstallDirectory + tstring(_T("gridrepublic.exe\""));
    fwprintf(f, _T("Attempting to launch gridrepublic.exe\n"));
    fwprintf(f, _T("Launching: '%s'\n"), strBuffer.c_str());
    if (CreateProcessAsUser( hRestrictedToken, NULL, (LPWSTR)strBuffer.c_str(), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup_info, &process_info ))
    {
        fwprintf(f, _T("Success!!!\n"));
        CloseHandle( process_info.hProcess );
        CloseHandle( process_info.hThread );
    }
    else
    {
        fwprintf(f, _T("CreateProcessAsUser retval: '%d'\n"), GetLastError());
    }

    strBuffer = tstring(_T("\"")) + strInstallDirectory + tstring(_T("charityengine.exe\""));
    fwprintf(f, _T("Attempting to launch charityengine.exe\n"));
    fwprintf(f, _T("Launching: '%s'\n"), strBuffer.c_str());
    if (CreateProcessAsUser( hRestrictedToken, NULL, (LPWSTR)strBuffer.c_str(), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup_info, &process_info ))
    {
        fwprintf(f, _T("Success!!!\n"));
        CloseHandle( process_info.hProcess );
        CloseHandle( process_info.hThread );
    }
    else
    {
        fwprintf(f, _T("CreateProcessAsUser retval: '%d'\n"), GetLastError());
    }

    strBuffer = tstring(_T("\"")) + strInstallDirectory + tstring(_T("progressthruprocessors.exe\""));
    fwprintf(f, _T("Attempting to launch progressthruprocessors.exe\n"));
    fwprintf(f, _T("Launching: '%s'\n"), strBuffer.c_str());
    if (CreateProcessAsUser( hRestrictedToken, NULL, (LPWSTR)strBuffer.c_str(), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup_info, &process_info ))
    {
        fwprintf(f, _T("Success!!!\n"));
        CloseHandle( process_info.hProcess );
        CloseHandle( process_info.hThread );
    }
    else
    {
        fwprintf(f, _T("CreateProcessAsUser retval: '%d'\n"), GetLastError());
    }

    fclose(f);
    CloseHandle( hRestrictedToken );
    pSCLOSEL( hSaferHandle );
 
    return ERROR_SUCCESS;
}
示例#15
0
unsigned long CMMap::GetCaptionColor()
{
	unsigned long result;
	GetProperty(0x8, VT_I4, (void*)&result);
	return result;
}
示例#16
0
CString CMMap::GetOutlineTitle()
{
	CString result;
	GetProperty(0x57, VT_BSTR, (void*)&result);
	return result;
}
示例#17
0
CString CMMap::GetConfiguration()
{
	CString result;
	GetProperty(0x5d, VT_BSTR, (void*)&result);
	return result;
}
示例#18
0
unsigned long CMMap::GetOutlineColor()
{
	unsigned long result;
	GetProperty(0x58, VT_I4, (void*)&result);
	return result;
}
示例#19
0
double CMMap::GetCaptionY()
{
	double result;
	GetProperty(0xd, VT_R8, (void*)&result);
	return result;
}
示例#20
0
short CMMap::GetOutlineWidth()
{
	short result;
	GetProperty(0x59, VT_I2, (void*)&result);
	return result;
}
示例#21
0
double CMMap::GetMapNorth()
{
	double result;
	GetProperty(0x1, VT_R8, (void*)&result);
	return result;
}
示例#22
0
short CMMap::GetOutlineAlign()
{
	short result;
	GetProperty(0x5a, VT_I2, (void*)&result);
	return result;
}
示例#23
0
short CMMap::GetBevelWidth()
{
	short result;
	GetProperty(0x11, VT_I2, (void*)&result);
	return result;
}
示例#24
0
BOOL CMMap::GetEnabled()
{
	BOOL result;
	GetProperty(DISPID_ENABLED, VT_BOOL, (void*)&result);
	return result;
}
示例#25
0
CString CMMap::GetFontName()
{
	CString result;
	GetProperty(0x13, VT_BSTR, (void*)&result);
	return result;
}
示例#26
0
BOOL CMMap::GetSingleBuffer()
{
	BOOL result;
	GetProperty(0x5b, VT_BOOL, (void*)&result);
	return result;
}
示例#27
0
CFontDisp CMMap::GetFont()
{
	LPDISPATCH pDispatch;
	GetProperty(DISPID_FONT, VT_DISPATCH, (void*)&pDispatch);
	return CFontDisp(pDispatch);
}
示例#28
0
BOOL CMMap::GetFocusOutline()
{
	BOOL result;
	GetProperty(0x5c, VT_BOOL, (void*)&result);
	return result;
}
示例#29
0
BOOL CMMap::GetFontBold()
{
	BOOL result;
	GetProperty(0x17, VT_BOOL, (void*)&result);
	return result;
}
long CPicture::GetHeight()
{
	long result;
	GetProperty(0x5, VT_I4, (void*)&result);
	return result;
}