Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: HaikuArchives/VMwareAddons
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aed6f601f0d7
Choose a base ref
...
head repository: HaikuArchives/VMwareAddons
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b98019e7b979
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 16, 2021

  1. Copy the full SHA
    b98019e View commit details
Showing with 23 additions and 13 deletions.
  1. +23 −13 vmware_video/kernel/device.c
36 changes: 23 additions & 13 deletions vmware_video/kernel/device.c
Original file line number Diff line number Diff line change
@@ -282,11 +282,17 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)

switch (msg) {
case B_GET_ACCELERANT_SIGNATURE:
strcpy((char *)buf, "vmware.accelerant");
if (user_strlcpy((char*)buf, "vmware.accelerant",
B_FILE_NAME_LENGTH) < B_OK) {
return B_BAD_ADDRESS;
}
return B_OK;

case VMWARE_GET_PRIVATE_DATA:
*((area_id *)buf) = gPd->sharedArea;
if (user_memcpy(buf, &gPd->sharedArea, sizeof(gPd->sharedArea))
< B_OK) {
return B_BAD_ADDRESS;
}
return B_OK;

case VMWARE_FIFO_START:
@@ -306,10 +312,12 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)

case VMWARE_SET_MODE:
{
display_mode *dm = buf;
WriteReg(SVGA_REG_WIDTH, dm->virtual_width);
WriteReg(SVGA_REG_HEIGHT, dm->virtual_height);
WriteReg(SVGA_REG_BITS_PER_PIXEL, BppForSpace(dm->space));
display_mode dm;
if (user_memcpy(&dm, buf, sizeof(display_mode)) < B_OK)
return B_BAD_ADDRESS;
WriteReg(SVGA_REG_WIDTH, dm.virtual_width);
WriteReg(SVGA_REG_HEIGHT, dm.virtual_height);
WriteReg(SVGA_REG_BITS_PER_PIXEL, BppForSpace(dm.space));
WriteReg(SVGA_REG_ENABLE, 1); //HAKILO
si->fbOffset = ReadReg(SVGA_REG_FB_OFFSET);
si->bytesPerRow = ReadReg(SVGA_REG_BYTES_PER_LINE);
@@ -323,7 +331,10 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)

case VMWARE_SET_PALETTE:
{
uint8 *color = (uint8 *)buf;
uint8 colors[3 * 256];
if (user_memcpy(colors, buf, sizeof(colors)) < B_OK)
return B_BAD_ADDRESS;
uint8 *color = colors;
uint32 i;
if (ReadReg(SVGA_REG_PSEUDOCOLOR) != 1)
return B_ERROR;
@@ -338,7 +349,9 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)

case VMWARE_MOVE_CURSOR:
{
uint16 *pos = buf;
uint16 pos[2];
if (user_memcpy(pos, buf, sizeof(pos)) < B_OK)
return B_BAD_ADDRESS;
si->cursorX = pos[0];
si->cursorY = pos[1];
UpdateCursor(si);
@@ -347,20 +360,17 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)

case VMWARE_SHOW_CURSOR:
{
si->cursorShow = *((bool *)buf);
if (user_memcpy(&si->cursorShow, buf, sizeof(bool)) < B_OK)
return B_BAD_ADDRESS;
UpdateCursor(si);
return B_OK;
}

case VMWARE_GET_DEVICE_NAME:
dprintf("device: VMWARE_GET_DEVICE_NAME %s\n", gPd->names[0]);
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
if (user_strlcpy((char *)buf, gPd->names[0],
B_PATH_NAME_LENGTH) < B_OK)
return B_BAD_ADDRESS;
#else
strlcpy((char *)buf, gPd->names[0], B_PATH_NAME_LENGTH);
#endif
return B_OK;

}