/* * DetectVMS * * Purpose: * * Execute detection methods. * */ VOID DetectVMS( VOID ) { BOOL cond = FALSE, bFound = FALSE; TCHAR szBuffer[MAX_PATH]; RtlSecureZeroMemory(szBuffer, sizeof(szBuffer)); do { if (IsSandboxiePresent()) { bFound = TRUE; _strcpy(szBuffer, VM_SANDBOXIE); if (AmISandboxed()) { _strcat(szBuffer, TEXT("\n")); _strcat(szBuffer, VM_SANDBOXIE_INSIDE); } #ifndef _FULLOUT break; #endif } if (IsHypervisor()) { bFound = TRUE; switch (GetHypervisorType()) { case 1: _strcpy(szBuffer, VM_MSHV); break; case 2: _strcpy(szBuffer, VM_VMWAREHV); break; case 3: _strcpy(szBuffer, VM_PRLHV); break; case 0: default: _strcpy(szBuffer, VM_UNKNOWNHV); break; } #ifndef _FULLOUT break; #endif } if (IsParallels()) { bFound = TRUE; _strcpy(szBuffer, VM_PARALLELS); #ifndef _FULLOUT break; #endif } if (IsVmWare()) { bFound = TRUE; _strcpy(szBuffer, VM_VMWARE); #ifndef _FULLOUT break; #endif } //there is no x64 guests support #ifndef _WIN64 if (IsVirtualPC()) { bFound = TRUE; _strcpy(szBuffer, VM_VPC); #ifndef _FULLOUT break; #endif } #endif if (IsVirtualBox()) { bFound = TRUE; _strcpy(szBuffer, VM_VBOX); #ifndef _FULLOUT break; #endif } if (IsUnknownVM()) { bFound = TRUE; _strcpy(szBuffer, VM_UNKNOWN); #ifndef _FULLOUT break; #endif } } while (cond); if (bFound) { DisplayText(szBuffer, MB_ICONWARNING); } else { DisplayText(TEXT("Nothing detected"), MB_ICONINFORMATION); } }
//long buildCounter = 0; //__________________________________________________________________ void _HYSequencePane::BuildPane (bool setport) { if (setport) { StartDraw(); EraseAll(); } if (columnStrings.lLength) { long visWidth = _HYCanvas::GetMaxW()-headerWidth-5, visHeight = _HYCanvas::GetMaxH()-5, rowCount = speciesIndex.lLength, slotHeight = GetSlotHeight(),h,v,lastColor = -1, selectionIndex = 0, c; if (settings.width&HY_COMPONENT_V_SCROLL) visWidth-=HY_SCROLLER_WIDTH; if (settings.width&HY_COMPONENT_H_SCROLL) visHeight-=HY_SCROLLER_WIDTH; if (startColumn<0) startColumn = 0; if (startRow<0) startRow = 0; if (setport) { endColumn = startColumn+visWidth/charWidth; h = (endColumn-startColumn)/5; endColumn = startColumn+(visWidth-h)/charWidth; endRow = startRow+visHeight/slotHeight; } if (endColumn>columnStrings.lLength) endColumn = columnStrings.lLength; if (endRow>rowCount) endRow = rowCount; _HYRect r = {0,0,visHeight,visWidth+headerWidth,1}, backCharRect; _HYColor blackC = {0,0,0}, charColor = {0,0,0}, whiteC = {255,255,255}, selectColor = highlightColor; if (setport) SetColor (backColor); else { selectColor = (_HYColor){160,160,160}; SetColor (whiteC); } FillRect (r); SetColor (blackC); BuildHeaders(); if (numbers) { r.left = 0; r.right = visWidth+headerWidth; r.bottom = (GetSlotHeight()+1); SetColor (headerColor); FillRect(r); if (setport) { SetColor (blackC); r.top = r.bottom; DrawLine (r); } } if (setport) { r.left = r.right = headerWidth; r.top = 0; r.bottom = visHeight; DrawLine (r); } r.left = r.right = headerWidth; r.top = 0; r.bottom = visHeight; h = HY_SEQUENCE_PANE_CHAR_SPACING/2+headerWidth; visWidth+=headerWidth; for (c = startColumn; c < endColumn; c++,h+=charWidth) { if (h+charWidth>visWidth) { endColumn = c; break; } bool isColumnSelected = false; if (selectionIndex<selection.lLength) { rowCount = selection.lData[selectionIndex]; while ((rowCount<c)&&(selectionIndex<selection.lLength)) { selectionIndex++; rowCount = selection.lData[selectionIndex]; } if (c==rowCount) { if (!invertColors) { _HYRect invR; invR.top = (GetSlotHeight()+1)+1; invR.bottom = visHeight-1; invR.right = h+charWidth; invR.left = h; if (c&&(c%blockWidth==0)) invR.right+=2; else if (c+1==endColumn) invR.right+=3; charColor = GetColor(); SetColor (selectColor); FillRect (invR); SetColor (charColor); } selectionIndex++; isColumnSelected = true; } } if (c && (c%blockWidth==0) && (setport|| c>startColumn) ) { SetColor (blackC); if (numbers) { _String number (c); #ifdef __MAC__ rowCount = h-2-GetVisibleStringWidth(number); #else rowCount = h-2-GetVisibleStringWidth(number, font); #endif if (rowCount>headerWidth) DisplayText (number,slotHeight-3,rowCount,true); } if (setport) { r.left = r.right = h; DrawLine (r); } SetColor (charColor); h+=2; } if (numbers) v = slotHeight+(GetSlotHeight()+1); else v = slotHeight; _String *thisString = (_String*)columnStrings(c); unsigned char topChar = showDots?thisString->sData[speciesIndex.lData[0]]:0; //if (!setport) //SetColor (blackC); backCharRect = (_HYRect) { v-slotHeight+1,h-1,v+1,h+charWidth-1,0 }; if ((c+1)%blockWidth == 0) backCharRect.right++; for (long r = startRow; r < endRow; r++,v+=slotHeight) { unsigned char thisC = thisString->sData[speciesIndex.lData[r]]; long myColor = colorMap[thisC]; if (r && thisC==topChar) thisC = '.'; //if (setport) { if (invertColors && !isColumnSelected) { charColor = LongToHYColor (characterColors.lData[myColor]); if ((long)charColor.R+charColor.G+charColor.B > 100) { SetColor (charColor); FillRect (backCharRect); } backCharRect.top += slotHeight; backCharRect.bottom += slotHeight; SetColor (blackC); } else if (colorMap[thisC]!=lastColor) { lastColor = colorMap[thisC]; charColor = LongToHYColor(characterColors.lData[lastColor]); SetColor (charColor); } } DisplayChar (thisC,v,h); } } if ((!setport)&&(c%blockWidth == 0)) { SetColor (blackC); if (numbers) { _String number (c); #ifdef __MAC__ rowCount = h-2-GetVisibleStringWidth(number); #else rowCount = h-2-GetVisibleStringWidth(number, font); #endif if (rowCount>headerWidth) DisplayText (number,slotHeight-3,rowCount,true); } } SetColor (blackC); r.left = 0; r.right = visWidth; if (settings.width&HY_COMPONENT_BORDER_B) { r.top = r.bottom = visHeight-1; if (setport) DrawLine(r); } } if (setport) EndDraw(); }
//__________________________________________________________________ void _HYSequencePane::HScrollPane (long dx) { #ifndef __HYPHY_GTK__ if (abs(dx)>=endColumn-startColumn-5) #endif { startColumn+=dx; BuildPane(); _MarkForUpdate(); return; } long visWidth = _HYCanvas::GetMaxW()-headerWidth-5, visHeight = _HYCanvas::GetMaxH()-5, slotHeight = GetSlotHeight(),h,v,lastColor = -1,adx, loopStart,loopEnd,selectionIndex = 0; if (settings.width&HY_COMPONENT_V_SCROLL) visWidth-=HY_SCROLLER_WIDTH; if (settings.width&HY_COMPONENT_H_SCROLL) visHeight-=HY_SCROLLER_WIDTH; if (dx>0) { if (endColumn+dx>columnStrings.lLength) dx = columnStrings.lLength-endColumn; adx = dx; v = (startColumn+dx)/blockWidth-startColumn/blockWidth; if (startColumn&&(startColumn%blockWidth==0)) v++; if ((startColumn+dx)&&((startColumn+dx)%blockWidth==0)) v--; } else { if (startColumn<-dx) dx=-startColumn; adx = -dx; v = startColumn/blockWidth-(startColumn+dx)/blockWidth; if (startColumn&&(startColumn%blockWidth==0)) v--; if ((startColumn+dx)&&((startColumn+dx)%blockWidth==0)) v++; } if (!dx) return; StartDraw(); h = adx*charWidth+2*v; _HYRect r = {0,0,visHeight,0,1}, backCharRect; visWidth+=headerWidth; startColumn+=dx; endColumn+=dx; if (dx>0) { r.left = headerWidth+1; r.right = visWidth; _SlideRect (r,0,-h); } else { r.left = headerWidth+1; r.right = visWidth; _SlideRect (r,0,h); } if (dx>0) { r.right = visWidth; r.left = r.right-h; } else { r.left = headerWidth+1; r.right = headerWidth+h+1; } SetColor (backColor); FillRect (r); _HYColor blackC = {0,0,0}, charColor = {0,0,0}, selectColor = highlightColor; r.top = 0; if (numbers) { r.bottom = (GetSlotHeight()+1); SetColor(headerColor); FillRect(r); r.top = r.bottom; } else r.top = r.bottom = 0; SetColor (blackC); if (settings.width&HY_COMPONENT_BORDER_T) DrawLine (r); if (settings.width&HY_COMPONENT_BORDER_B) { r.top = r.bottom = visHeight-1; DrawLine (r); } r.top = 0; if (dx<0) { if (numbers) { SetColor (headerColor); r.bottom = (GetSlotHeight()+1); r.left = 0; r.right = headerWidth; FillRect (r); } h = HY_SEQUENCE_PANE_CHAR_SPACING/2+headerWidth; } else { h = HY_SEQUENCE_PANE_CHAR_SPACING/2+headerWidth; for (v=startColumn;v<endColumn-dx;v++,h+=charWidth) if (v&&(v%blockWidth)==0) h+=2; } r.bottom = visHeight; loopStart = dx>0?endColumn-dx:startColumn; loopEnd = dx>0?endColumn:startColumn-dx; if (loopStart<0) loopStart = 0; if (loopEnd<0) loopEnd = 0; if (loopStart>columnStrings.lLength) loopStart = columnStrings.lLength; if (loopEnd>columnStrings.lLength) loopEnd = columnStrings.lLength; for (long c = loopStart; c < loopEnd; c++,h+=charWidth) { bool isColumnSelected = false; if (selectionIndex<selection.lLength) { visWidth = selection.lData[selectionIndex]; while ((visWidth<c)&&(selectionIndex<selection.lLength)) { selectionIndex++; visWidth = selection.lData[selectionIndex]; } if (c==visWidth) { if (!invertColors) { _HYRect invR; invR.top = (GetSlotHeight()+1)+1; invR.bottom = visHeight-1; invR.right = h+charWidth; invR.left = h-2; if (c&&(c%blockWidth==0)) invR.right+=2; /*else if ((c+1==loopEnd)&&(dx>0)) invR.right+=3; */ charColor = GetColor(); SetColor (selectColor); FillRect (invR); SetColor (charColor); } selectionIndex++; isColumnSelected = true; } } if (c&&(c%blockWidth==0)) { SetColor (blackC); if (numbers) { _String number (c); #ifdef __MAC__ visWidth = h-2-GetVisibleStringWidth(number); #else visWidth = h-2-GetVisibleStringWidth(number, font); #endif if (visWidth>headerWidth) DisplayText (number,slotHeight-3,visWidth,true); } r.left = r.right = h; DrawLine (r); SetColor (charColor); h+=2; } if (numbers) v = slotHeight+(GetSlotHeight()+1); else v = slotHeight; _String *thisString = (_String*)columnStrings(c); unsigned char topChar = showDots?thisString->sData[speciesIndex.lData[0]]:0; backCharRect = (_HYRect) { v-slotHeight+1,h-1,v+1,h+charWidth-1,0 }; if ((c+1)%blockWidth == 0) backCharRect.right++; for (long r = startRow; r < endRow; r++,v+=slotHeight) { /*unsigned char thisC = thisString->sData[speciesIndex.lData[r]]; if (r&&(thisC==topChar)) thisC = '.'; if (colorMap[thisC]!=lastColor) { lastColor = colorMap[thisC]; charColor = LongToHYColor(characterColors.lData[lastColor]); SetColor (charColor); } DisplayChar (thisC,v,h);*/ unsigned char thisC = thisString->sData[speciesIndex.lData[r]]; long myColor = colorMap[thisC]; if (r && thisC==topChar) thisC = '.'; if (invertColors && !isColumnSelected) { charColor = LongToHYColor (characterColors.lData[myColor]); if ((long)charColor.R+charColor.G+charColor.B > 100) { SetColor (charColor); FillRect (backCharRect); } backCharRect.top += slotHeight; backCharRect.bottom += slotHeight; SetColor (blackC); } else if (colorMap[thisC]!=lastColor) { lastColor = colorMap[thisC]; charColor = LongToHYColor(characterColors.lData[lastColor]); SetColor (charColor); } DisplayChar (thisC,v,h); } } if (numbers&&(dx<0)) { loopEnd--; v = loopEnd%blockWidth; visWidth = blockWidth-log(double(loopEnd+blockWidth-1))/log((double)blockWidth); if (adx<blockWidth) { loopStart = (startColumn-dx)%blockWidth; if ((startColumn-dx)/blockWidth!=startColumn/blockWidth) // scrolled thru a block divider { if (loopStart==0) h += (blockWidth-v-1)*charWidth; else h = 0; } else { if (loopStart>visWidth) h += (blockWidth-v-1)*charWidth; else h = 0; } } else { loopStart = (startColumn-dx)%blockWidth; if (loopStart) if (loopStart>=visWidth) h -= (loopStart-blockWidth)*charWidth; else h = 0; } if (h) { _String number (v?((loopEnd/blockWidth)+1)*blockWidth:loopEnd); SetColor (blackC); #ifdef __MAC__ visWidth = h-2-GetVisibleStringWidth(number); #else visWidth = h-2-GetVisibleStringWidth(number, font); #endif while ((visWidth < headerWidth)&&(number.sLength)) { number.Trim (1,-1); #ifdef __MAC__ visWidth = h-2-GetVisibleStringWidth(number); #else visWidth = h-2-GetVisibleStringWidth(number, font); #endif } if (number.sLength) DisplayText (number,slotHeight-3,visWidth,true); } } EndDraw(); if (messageRecipient) messageRecipient->ProcessEvent(generateScrollEvent(0,0)); _MarkForUpdate(); }
//__________________________________________________________________ void _HYSequencePane::BuildHeaders (void) { long h,v,slotHeight = GetSlotHeight(),k; long visWidth = _HYCanvas::GetMaxW()-headerWidth-5, visHeight = _HYCanvas::GetMaxH()-5, selectionIndex = 0; if (settings.width&HY_COMPONENT_V_SCROLL) visWidth-=HY_SCROLLER_WIDTH; if (settings.width&HY_COMPONENT_H_SCROLL) visHeight-=HY_SCROLLER_WIDTH; if (headerWidth) { _HYRect r = {0,0,0,0,1}; _HYColor blackC = {0,0,0}, selectColor = highlightColor; SetColor(headerColor); r.right = headerWidth; if (numbers) { r.bottom = (GetSlotHeight()+1)-1; FillRect(r); r.top = r.bottom+2; } else r.top = 0; r.bottom = visHeight; FillRect(r); if (numbers) v = slotHeight+(GetSlotHeight()+1); else v = slotHeight; if (vselection.lLength) { SetColor (selectColor); for (h=startRow; h<endRow; h++) { if (selectionIndex<vselection.lLength) { k = vselection.lData[selectionIndex]; while ((k<h)&&(selectionIndex<vselection.lLength)) { selectionIndex++; k = vselection.lData[selectionIndex]; } if (h==k) { _HYRect invR; invR.left = 0; invR.right = headerWidth; invR.top = (h-startRow)*slotHeight+(GetSlotHeight()+1)+2; invR.bottom = invR.top+slotHeight; FillRect (invR); selectionIndex++; } } else break; } } SetColor (blackC); for (h=startRow; h<endRow; h++) if (nameDisplayFlags&HY_SEQUENCE_PANE_NAMES_SHORT) { for (h=startRow; h<endRow; h++,v+=slotHeight) { _String *thisString = (_String*)rowHeaders(speciesIndex.lData[h]); if (thisString->sLength<=HY_SEQUENCE_PANE_SHORT_WIDTH) DisplayText (*thisString,v,HY_SEQUENCE_PANE_CHAR_SPACING/2,true); else { _String chopped (*thisString); chopped.Trim(0,HY_SEQUENCE_PANE_SHORT_WIDTH-1); chopped.sData[HY_SEQUENCE_PANE_SHORT_WIDTH-1]='-'; DisplayText (chopped,v,HY_SEQUENCE_PANE_CHAR_SPACING/2,true); } } } else for (h=startRow; h<endRow; h++,v+=slotHeight) { DisplayText (*(_String*)rowHeaders(speciesIndex.lData[h]),v,HY_SEQUENCE_PANE_CHAR_SPACING/2,true); } } }