Changeset 27687 in vbox for trunk/src/VBox/Additions/common/VBoxGuestLib
- Timestamp:
- Mar 24, 2010 10:14:20 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r27602 r27687 149 149 VBoxGuestR3LibMisc.cpp \ 150 150 VBoxGuestR3LibSeamless.cpp \ 151 VBoxGuestR3LibVideo.cpp 151 VBoxGuestR3LibVideo.cpp \ 152 VBoxGuestR3LibRuntimeXF86.cpp 153 VBoxGuestR3LibRuntimeXF86.cpp_CXXFLAGS = -Wno-shadow 152 154 VBoxGuestR3LibXFree86_INCS = \ 153 155 $(VBOX_PATH_X11_XFREE_4_3)/programs/Xserver/hw/xfree86/common/ \ 154 156 $(VBOX_PATH_X11_XFREE_4_3)/programs/Xserver/hw/xfree86/os-support \ 155 157 $(VBOX_PATH_X11_XFREE_4_3)/programs/Xserver/include \ 158 $(VBOX_PATH_X11_XFREE_4_3)/include \ 156 159 $(VBOX_PATH_X11_XFREE_4_3)/exports/include/X11 157 160 -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h
r26425 r27687 38 38 #include <VBox/VBoxGuest.h> 39 39 #include <VBox/VBoxGuestLib.h> 40 41 #ifdef VBOX_VBGLR3_XFREE86 42 /* Rather than try to resolve all the header file conflicts, I will just 43 prototype what we need here. */ 44 typedef unsigned long xf86size_t; 45 extern "C" xf86size_t xf86strlen(const char*); 46 # undef strlen 47 # define strlen xf86strlen 48 #endif /* VBOX_VBGLR3_XFREE86 */ 40 49 41 50 RT_C_DECLS_BEGIN -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
r26425 r27687 99 99 { 100 100 uint32_t cInits = ASMAtomicIncU32(&g_cInits); 101 #ifndef VBOX_VBGLR3_XFREE86102 101 Assert(cInits > 0); 103 #endif104 102 if (cInits > 1) 105 103 { -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibEvent.cpp
r27083 r27687 55 55 VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents) 56 56 { 57 #ifndef VBOX_VBGLR3_XFREE8658 57 LogFlow(("VbglR3WaitEvent: fMask=0x%x, cMillies=%u, pfEvents=%p\n", 59 58 fMask, cMillies, pfEvents)); 60 59 AssertReturn((fMask & ~VMMDEV_EVENT_VALID_EVENT_MASK) == 0, VERR_INVALID_PARAMETER); 61 60 AssertPtrNullReturn(pfEvents, VERR_INVALID_POINTER); 62 #endif63 61 64 62 VBoxGuestWaitEventInfo waitEvent; … … 70 68 if (RT_SUCCESS(rc)) 71 69 { 72 #if !defined(VBOX_VBGLR3_XFREE86) && !defined(RT_OS_WINDOWS)73 70 AssertMsg(waitEvent.u32Result == VBOXGUEST_WAITEVENT_OK, ("%d rc=%Rrc\n", waitEvent.u32Result, rc)); 74 #endif75 71 if (pfEvents) 76 72 *pfEvents = waitEvent.u32EventFlagsOut; 77 73 } 78 74 79 #ifndef VBOX_VBGLR3_XFREE8680 75 LogFlow(("VbglR3WaitEvent: rc=%Rrc, u32EventFlagsOut=0x%x. u32Result=%d\n", 81 76 rc, waitEvent.u32EventFlagsOut, waitEvent.u32Result)); 82 #endif83 77 return rc; 84 78 } -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp
r26425 r27687 33 33 * Header Files * 34 34 *******************************************************************************/ 35 #ifdef VBOX_VBGLR3_XFREE86 36 /* Rather than try to resolve all the header file conflicts, I will just 37 prototype what we need here. */ 38 # define xalloc(size) Xalloc((unsigned long)(size)) 39 # define xfree(ptr) Xfree((pointer)(ptr)) 40 typedef void *pointer; 41 extern "C" pointer Xalloc(unsigned long /*amount*/); 42 extern "C" void Xfree(pointer /*ptr*/); 43 #else 44 # include <iprt/mem.h> 45 # include <iprt/assert.h> 46 # include <iprt/string.h> 47 #endif 35 #include <iprt/mem.h> 36 #include <iprt/assert.h> 37 #include <iprt/string.h> 48 38 #include <iprt/err.h> 49 39 #include "VBGLR3Internal.h" … … 54 44 VMMDevRequestHeader *pReq; 55 45 56 #ifdef VBOX_VBGLR3_XFREE8657 pReq = (VMMDevRequestHeader *)xalloc(cb);58 #else59 46 AssertPtrReturn(ppReq, VERR_INVALID_PARAMETER); 60 47 AssertMsgReturn(cb >= sizeof(VMMDevRequestHeader), ("%#x vs %#zx\n", cb, sizeof(VMMDevRequestHeader)), … … 62 49 63 50 pReq = (VMMDevRequestHeader *)RTMemTmpAlloc(cb); 64 #endif65 51 if (RT_UNLIKELY(!pReq)) 66 52 return VERR_NO_MEMORY; … … 87 73 void vbglR3GRFree(VMMDevRequestHeader *pReq) 88 74 { 89 #ifdef VBOX_VBGLR3_XFREE8690 xfree(pReq);91 #else92 75 RTMemTmpFree(pReq); 93 #endif94 76 } 95 77 -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp
r26425 r27687 43 43 #include "VBGLR3Internal.h" 44 44 45 #ifdef VBOX_VBGLR3_XFREE86 46 /* Rather than try to resolve all the header file conflicts, I will just 47 prototype what we need here. */ 48 extern "C" char* xf86strcpy(char*,const char*); 49 # undef strcpy 50 # define strcpy xf86strcpy 51 extern "C" void* xf86memchr(const void*,int,xf86size_t); 52 # undef memchr 53 # define memchr xf86memchr 54 #endif /* VBOX_VBGLR3_XFREE86 */ 45 55 46 56 /******************************************************************************* … … 205 215 } 206 216 207 217 #ifndef VBOX_VBGLR3_XFREE86 208 218 /** 209 219 * Write a property value where the value is formatted in RTStrPrintfV fashion. … … 250 260 return rc; 251 261 } 252 262 #endif /* VBOX_VBGLR3_XFREE86 */ 253 263 254 264 /** … … 347 357 } 348 358 349 359 #ifndef VBOX_VBGLR3_XFREE86 350 360 /** 351 361 * Retrieve a property value, allocating space for it. … … 427 437 RTMemFree(pszValue); 428 438 } 429 439 #endif /* VBOX_VBGLR3_XFREE86 */ 430 440 431 441 /** … … 452 462 uint32_t *pcchValueActual) 453 463 { 454 char *pszBuf = NULL; 455 int rc = VbglR3GuestPropReadValueAlloc(u32ClientId, pszName, &pszBuf); 456 if (RT_SUCCESS(rc)) 457 { 458 size_t cchValueActual = strlen(pszBuf) + 1; 459 if (cchValueActual <= cchValue) 460 memcpy(pszValue, pszBuf, cchValueActual); 461 else 462 { 463 if (pcchValueActual != NULL) 464 *pcchValueActual = (uint32_t)cchValueActual; 465 rc = VERR_BUFFER_OVERFLOW; 466 } 467 } 468 VbglR3GuestPropReadValueFree(pszBuf); 469 return rc; 470 } 471 472 464 void *pvBuf = pszValue; 465 uint32_t cchValueActual; 466 int rc = VbglR3GuestPropRead(u32ClientId, pszName, pvBuf, cchValue, 467 &pszValue, NULL, NULL, &cchValueActual); 468 if (pcchValueActual != NULL) 469 *pcchValueActual = cchValueActual; 470 return rc; 471 } 472 473 474 #ifndef VBOX_VBGLR3_XFREE86 473 475 /** 474 476 * Raw API for enumerating guest properties which match a given pattern. … … 912 914 return VINF_SUCCESS; 913 915 } 914 916 #endif /* VBOX_VBGLR3_XFREE86 */ -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r27083 r27687 70 70 Req.u32NotMask = fNot; 71 71 int rc = vbglR3GRPerform(&Req.header); 72 #if defined(DEBUG) && !defined(VBOX_VBGLR3_XFREE86)72 #if defined(DEBUG) 73 73 if (RT_SUCCESS(rc)) 74 74 LogRel(("Successfully changed guest capabilities: or mask 0x%x, not mask 0x%x.\n", fOr, fNot)); -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
r27318 r27687 67 67 int rc; 68 68 69 #if !defined(VBOX_VBGLR3_XFREE86)70 69 AssertPtrReturn(pMode, VERR_INVALID_PARAMETER); 71 #endif72 70 waitEvent.u32TimeoutIn = RT_INDEFINITE_WAIT; 73 71 waitEvent.u32EventMaskIn = VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST; … … 111 109 int rc; 112 110 113 #if !defined(VBOX_VBGLR3_XFREE86)114 111 AssertPtrReturn(pMode, VERR_INVALID_PARAMETER); 115 #endif116 112 117 113 /* get the seamless change request */ -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
r27508 r27687 151 151 VMMDevDisplayChangeRequest2 Req; 152 152 153 #ifndef VBOX_VBGLR3_XFREE86154 153 AssertPtrReturn(pcx, VERR_INVALID_PARAMETER); 155 154 AssertPtrReturn(pcy, VERR_INVALID_PARAMETER); 156 155 AssertPtrReturn(pcBits, VERR_INVALID_PARAMETER); 157 156 AssertPtrReturn(piDisplay, VERR_INVALID_PARAMETER); 158 #endif159 157 RT_ZERO(Req); 160 158 vmmdevInitRequest(&Req.header, VMMDevReq_GetDisplayChangeRequest2); … … 212 210 VBGLR3DECL(int) VbglR3SaveVideoMode(const char *pszName, uint32_t cx, uint32_t cy, uint32_t cBits) 213 211 { 214 #if defined(VBOX_WITH_GUEST_PROPS) && !defined(VBOX_VBGLR3_XFREE86)212 #if defined(VBOX_WITH_GUEST_PROPS) 215 213 using namespace guestProp; 216 214 … … 226 224 VbglR3GuestPropDisconnect(u32ClientId); /* Return value ignored, because what can we do anyway? */ 227 225 return rc; 228 #else /* !VBOX_WITH_GUEST_PROPS || VBOX_VBGLR3_XFREE86*/226 #else /* !VBOX_WITH_GUEST_PROPS */ 229 227 return VERR_NOT_IMPLEMENTED; 230 #endif /* !VBOX_WITH_GUEST_PROPS || VBOX_VBGLR3_XFREE86*/228 #endif /* !VBOX_WITH_GUEST_PROPS */ 231 229 } 232 230 … … 243 241 VBGLR3DECL(int) VbglR3RetrieveVideoMode(const char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits) 244 242 { 245 #if defined(VBOX_WITH_GUEST_PROPS) && !defined(VBOX_VBGLR3_XFREE86)243 #if defined(VBOX_WITH_GUEST_PROPS) 246 244 using namespace guestProp; 247 245 … … 304 302 } 305 303 return rc; 306 #else /* !VBOX_WITH_GUEST_PROPS || VBOX_VBGLR3_XFREE86*/304 #else /* !VBOX_WITH_GUEST_PROPS */ 307 305 return VERR_NOT_IMPLEMENTED; 308 #endif /* !VBOX_WITH_GUEST_PROPS || VBOX_VBGLR3_XFREE86*/309 } 306 #endif /* !VBOX_WITH_GUEST_PROPS */ 307 }
Note:
See TracChangeset
for help on using the changeset viewer.