Changeset 8565 in vbox for trunk/src/VBox
- Timestamp:
- May 5, 2008 12:01:52 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
r8155 r8565 66 66 *******************************************************************************/ 67 67 68 /** The control thread (main) handle. 68 /** The control thread (main) handle. 69 69 * Only used to avoid some queue creation trouble. */ 70 70 static RTTHREAD g_ThreadCtrl = NIL_RTTHREAD; … … 91 91 /** The timer id returned by WinStartTimer. */ 92 92 static ULONG g_idWorkerTimer = ~0UL; 93 /** The state of the clipboard. 93 /** The state of the clipboard. 94 94 * @remark I'm trying out the 'k' prefix from the mac here, bear with me. */ 95 95 static enum 96 { 96 { 97 97 /** The clipboard hasn't been initialized yet. */ 98 98 kClipboardState_Uninitialized = 0, … … 101 101 /** We're monitoring the clipboard as a viewer. */ 102 102 kClipboardState_Viewer, 103 /** We're monitoring the clipboard using polling. 103 /** We're monitoring the clipboard using polling. 104 104 * This usually means something is wrong... */ 105 105 kClipboardState_Polling, … … 112 112 static bool g_fEmptyClipboard = false; 113 113 114 /** A clipboard format atom for the dummy clipboard data we insert 115 * watching for clipboard changes. If this format is found on the 116 * clipboard, the empty clipboard function has not been called 114 /** A clipboard format atom for the dummy clipboard data we insert 115 * watching for clipboard changes. If this format is found on the 116 * clipboard, the empty clipboard function has not been called 117 117 * since we last polled it. */ 118 118 static ATOM g_atomNothingChanged = 0; … … 157 157 158 158 /* 159 * Since we have to send shutdown messages and such from the 159 * Since we have to send shutdown messages and such from the 160 160 * service controller (main) thread, create a HAB and HMQ for it. 161 161 */ … … 193 193 g_atomOdin32UnicodeText = WinFindAtom(WinQuerySystemAtomTable(), SZFMT_ODIN32_UNICODETEXT); 194 194 if (g_atomOdin32UnicodeText == 0) 195 VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n", 195 VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n", 196 196 lLastError, WinGetLastError(g_habCtrl)); 197 197 198 VBoxServiceVerbose(2, "g_u32ClientId=%RX32 g_atomNothingChanged=%#x g_atomOdin32UnicodeText=%#x\n", 198 VBoxServiceVerbose(2, "g_u32ClientId=%RX32 g_atomNothingChanged=%#x g_atomOdin32UnicodeText=%#x\n", 199 199 g_u32ClientId, g_atomNothingChanged, g_atomOdin32UnicodeText); 200 200 return VINF_SUCCESS; … … 204 204 } 205 205 else 206 VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n", 206 VBoxServiceError("WinAddAtom() failed, lasterr=%lx; WinFindAtom() failed, lasterror=%lx\n", 207 207 lLastError, WinGetLastError(g_habCtrl)); 208 208 } … … 237 237 g_enmState = kClipboardState_Polling; 238 238 if ((int)g_enmState != iOrgState) 239 { 239 { 240 240 if (g_enmState == kClipboardState_Viewer) 241 241 VBoxServiceVerbose(3, "clipboard: viewer\n"); … … 253 253 /* 254 254 * Open the clipboard and switch to 'destruction' mode. 255 * Make sure we stop being viewer. Temporarily also make sure we're 255 * Make sure we stop being viewer. Temporarily also make sure we're 256 256 * not the owner so that PM won't send us any WM_DESTROYCLIPBOARD message. 257 257 */ … … 259 259 { 260 260 if (g_enmState == kClipboardState_Viewer) 261 WinSetClipbrdViewer(g_habWorker, NULLHANDLE); 261 WinSetClipbrdViewer(g_habWorker, NULLHANDLE); 262 262 if (g_enmState == kClipboardState_Owner) 263 WinSetClipbrdOwner(g_habWorker, NULLHANDLE); 263 WinSetClipbrdOwner(g_habWorker, NULLHANDLE); 264 264 265 265 g_enmState = kClipboardState_Destroying; … … 343 343 344 344 /* 345 * The Odin32 stuff is simple, we just assume windows data from the host 345 * The Odin32 stuff is simple, we just assume windows data from the host 346 346 * and all we need to do is add the header. 347 347 */ 348 if ( usFmt 348 if ( usFmt 349 349 && ( usFmt == g_atomOdin32UnicodeText 350 350 /* || usFmt == ...*/ … … 358 358 * 359 359 * Note that we probably should be using the current PM or DOS codepage 360 * here instead of the LC_CTYPE one which iconv uses by default. 360 * here instead of the LC_CTYPE one which iconv uses by default. 361 361 * -lazybird 362 362 */ … … 388 388 VBoxServiceError("RTUtf16ToUtf8() -> %Rrc\n", rc); 389 389 } 390 390 391 391 return pvPM; 392 392 } … … 395 395 /** 396 396 * Tries to deliver an advertised host format. 397 * 397 * 398 398 * @param usFmt The PM format name. 399 * 400 * @remark We must not try open the clipboard here because WM_RENDERFMT is a 401 * request send synchronously by someone who has already opened the 399 * 400 * @remark We must not try open the clipboard here because WM_RENDERFMT is a 401 * request send synchronously by someone who has already opened the 402 402 * clipboard. We would enter a deadlock trying to open it here. 403 * 403 * 404 404 */ 405 405 static void VBoxServiceClipboardOS2RenderFormat(USHORT usFmt) … … 413 413 if ( usFmt == CF_TEXT 414 414 || usFmt == g_atomOdin32UnicodeText) 415 fFormat = VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 415 fFormat = VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; 416 416 else /** @todo bitmaps */ 417 417 fFormat = 0; 418 418 if (fFormat) 419 419 { 420 /* 420 /* 421 421 * Query the data from the host. 422 422 * This might require two iterations because of buffer guessing. … … 492 492 PVOID pvPM; 493 493 PCLIPHEADER pHdr = (PCLIPHEADER)WinQueryClipbrdData(g_habWorker, g_atomOdin32UnicodeText); 494 if ( pHdr 494 if ( pHdr 495 495 && !memcmp(pHdr->achMagic, CLIPHEADER_MAGIC, sizeof(pHdr->achMagic))) 496 496 { … … 548 548 while ((ulFormat = WinEnumClipbrdFmts(g_habWorker, ulFormat)) != 0) 549 549 { 550 if ( ulFormat == CF_TEXT 550 if ( ulFormat == CF_TEXT 551 551 || ulFormat == g_atomOdin32UnicodeText) 552 552 fFormats |= VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; … … 560 560 /** 561 561 * Poll the clipboard for changes. 562 * 563 * This is called both when we're the viewer and when we're 562 * 563 * This is called both when we're the viewer and when we're 564 564 * falling back to polling. If something has changed it will 565 565 * notify the host. … … 580 580 g_fEmptyClipboard = false; 581 581 VBoxServiceClipboardOS2ReportFormats(); 582 582 583 583 /* inject the dummy */ 584 584 PVOID pv; … … 632 632 /** 633 633 * The window procedure for the object window. 634 * 634 * 635 635 * @returns Message result. 636 * 636 * 637 637 * @param hwnd The window handle. 638 638 * @param msg The message. … … 665 665 break; 666 666 667 /* 667 /* 668 668 * Clipboard viewer message - the content has been changed. 669 * This is sent *after* releasing the clipboard sem 669 * This is sent *after* releasing the clipboard sem 670 670 * and during the WinSetClipbrdViewer call. 671 671 */ … … 673 673 if (g_enmState == kClipboardState_SettingViewer) 674 674 break; 675 AssertMsgBreak (g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState),);675 AssertMsgBreakVoid(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState)); 676 676 VBoxServiceClipboardOS2Poll(); 677 677 break; 678 678 679 /* 679 /* 680 680 * Clipboard owner message - the content was replaced. 681 681 * This is sent by someone with an open clipboard, so don't try open it now. … … 684 684 if (g_enmState == kClipboardState_Destroying) 685 685 break; /* it's us doing the replacing, ignore. */ 686 AssertMsgBreak (g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState),);686 AssertMsgBreakVoid(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState)); 687 687 VBoxServiceClipboardOS2Destroyed(); 688 688 break; … … 693 693 */ 694 694 case WM_RENDERFMT: 695 AssertMsgBreak (g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState),);695 AssertMsgBreakVoid(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState)); 696 696 VBoxServiceClipboardOS2RenderFormat(SHORT1FROMMP(mp1)); 697 697 break; 698 698 699 699 /* 700 * Clipboard owner message - we're about to quit and should render all formats. 700 * Clipboard owner message - we're about to quit and should render all formats. 701 701 * 702 * However, because we're lazy, we'll just ASSUME that since we're quitting 703 * we're probably about to shutdown or something and there is no point in 704 * doing anything here except for emptying the clipboard and removing 702 * However, because we're lazy, we'll just ASSUME that since we're quitting 703 * we're probably about to shutdown or something and there is no point in 704 * doing anything here except for emptying the clipboard and removing 705 705 * ourselves as owner. Any failures at this point are silently ignored. 706 706 */ … … 730 730 731 731 /* 732 * This is just a fallback polling strategy in case some other 732 * This is just a fallback polling strategy in case some other 733 733 * app is trying to view the clipboard too. We also use this 734 734 * to try recover from errors. … … 740 740 */ 741 741 case WM_TIMER: 742 if ( g_enmState != kClipboardState_Viewer 742 if ( g_enmState != kClipboardState_Viewer 743 743 && g_enmState != kClipboardState_Polling) 744 744 break; … … 758 758 759 759 760 /* 760 /* 761 761 * Clipboard owner messages dealing with owner drawn content. 762 762 * We shouldn't be seeing any of these. … … 771 771 /* 772 772 * We shouldn't be seeing any other messages according to the docs. 773 * But for whatever reason, PM sends us a WM_ADJUSTWINDOWPOS message 773 * But for whatever reason, PM sends us a WM_ADJUSTWINDOWPOS message 774 774 * during WinCreateWindow. So, ignore that and assert on anything else. 775 775 */ … … 785 785 /** 786 786 * The listener thread. 787 * 788 * This thread is dedicated to listening for host messages and forwarding 787 * 788 * This thread is dedicated to listening for host messages and forwarding 789 789 * these to the worker thread (using PM). 790 * 790 * 791 791 * The thread will set g_fListenerOkay and signal its user event when it has 792 792 * completed initialization. In the case of init failure g_fListenerOkay will 793 793 * not be set. 794 * 794 * 795 795 * @returns Init error code or VINF_SUCCESS. 796 796 * @param ThreadSelf Our thread handle. … … 827 827 rc = VbglR3ClipboardGetHostMsg(g_u32ClientId, &Msg, &fFormats); 828 828 if (RT_SUCCESS(rc)) 829 { 829 { 830 830 VBoxServiceVerbose(3, "VBoxServiceClipboardOS2Listener: Msg=%#x fFormats=%#x\n", Msg, fFormats); 831 831 switch (Msg) 832 832 { 833 /* 834 * The host has announced available clipboard formats. 833 /* 834 * The host has announced available clipboard formats. 835 835 * Forward the information to the window, so it can later 836 836 * respond do WM_RENDERFORMAT message. 837 837 */ 838 838 case VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS: 839 if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS, 839 if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS, 840 840 MPFROMLONG(fFormats), 0)) 841 VBoxServiceError("WinPostMsg(%lx, FORMATS,,) failed, lasterr=%#lx\n", 841 VBoxServiceError("WinPostMsg(%lx, FORMATS,,) failed, lasterr=%#lx\n", 842 842 g_hwndWorker, WinGetLastError(g_habListener)); 843 843 break; 844 844 845 /* 845 /* 846 846 * The host needs data in the specified format. 847 847 */ 848 848 case VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA: 849 if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA, 849 if (!WinPostMsg(g_hwndWorker, WM_USER + VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA, 850 850 MPFROMLONG(fFormats), 0)) 851 VBoxServiceError("WinPostMsg(%lx, READ_DATA,,) failed, lasterr=%#lx\n", 851 VBoxServiceError("WinPostMsg(%lx, READ_DATA,,) failed, lasterr=%#lx\n", 852 852 g_hwndWorker, WinGetLastError(g_habListener)); 853 853 break; … … 918 918 if (g_hwndWorker != NULLHANDLE) 919 919 { 920 VBoxServiceVerbose(3, "g_hwndWorker=%#lx g_habWorker=%#lx g_hmqWorker=%#lx\n", g_hwndWorker, g_habWorker, g_hmqWorker); 920 VBoxServiceVerbose(3, "g_hwndWorker=%#lx g_habWorker=%#lx g_hmqWorker=%#lx\n", g_hwndWorker, g_habWorker, g_hmqWorker); 921 921 922 922 /* … … 935 935 { 936 936 /* 937 * Tell the control thread that it can continue 937 * Tell the control thread that it can continue 938 938 * spawning services. 939 939 */ … … 1014 1014 * The OS/2 'clipboard' service description. 1015 1015 */ 1016 VBOXSERVICE g_Clipboard = 1016 VBOXSERVICE g_Clipboard = 1017 1017 { 1018 1018 /* pszName. */ -
trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp
r8155 r8565 618 618 { 619 619 /* Check arguments. */ 620 AssertMsgBreak (cEntriesAlloc,621 ("cEntriesAlloc=%u\n", cEntriesAlloc),622 rc = VERR_INVALID_PARAMETER);623 AssertMsgBreak (VALID_PTR(pEntries),624 ("pEntries=%#p\n", pEntries),625 rc = VERR_INVALID_PARAMETER);626 AssertMsgBreak (VALID_PTR(pcEntriesUsed),627 ("pcEntriesUsed=%#p\n", pcEntriesUsed),628 rc = VERR_INVALID_PARAMETER);620 AssertMsgBreakStmt(cEntriesAlloc, 621 ("cEntriesAlloc=%u\n", cEntriesAlloc), 622 rc = VERR_INVALID_PARAMETER); 623 AssertMsgBreakStmt(VALID_PTR(pEntries), 624 ("pEntries=%#p\n", pEntries), 625 rc = VERR_INVALID_PARAMETER); 626 AssertMsgBreakStmt(VALID_PTR(pcEntriesUsed), 627 ("pcEntriesUsed=%#p\n", pcEntriesUsed), 628 rc = VERR_INVALID_PARAMETER); 629 629 630 630 /* First enumerate static backends. */ … … 773 773 { 774 774 /* Check arguments. */ 775 AssertMsgBreak (VALID_PTR(pfnError),776 ("pfnError=%#p\n", pfnError),777 rc = VERR_INVALID_PARAMETER);778 AssertMsgBreak (VALID_PTR(ppDisk),779 ("ppDisk=%#p\n", ppDisk),780 rc = VERR_INVALID_PARAMETER);775 AssertMsgBreakStmt(VALID_PTR(pfnError), 776 ("pfnError=%#p\n", pfnError), 777 rc = VERR_INVALID_PARAMETER); 778 AssertMsgBreakStmt(VALID_PTR(ppDisk), 779 ("ppDisk=%#p\n", ppDisk), 780 rc = VERR_INVALID_PARAMETER); 781 781 782 782 pDisk = (PVBOXHDD)RTMemAllocZ(sizeof(VBOXHDD)); … … 854 854 { 855 855 /* Check arguments. */ 856 AssertMsgBreak (VALID_PTR(pszFilename) && *pszFilename,857 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename),858 rc = VERR_INVALID_PARAMETER);859 AssertMsgBreak (VALID_PTR(ppszFormat),860 ("ppszFormat=%#p\n", ppszFormat),861 rc = VERR_INVALID_PARAMETER);856 AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 857 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 858 rc = VERR_INVALID_PARAMETER); 859 AssertMsgBreakStmt(VALID_PTR(ppszFormat), 860 ("ppszFormat=%#p\n", ppszFormat), 861 rc = VERR_INVALID_PARAMETER); 862 862 863 863 /* First check if static backends support this file format. */ … … 1037 1037 1038 1038 /* Check arguments. */ 1039 AssertMsgBreak (VALID_PTR(pszBackend) && *pszBackend,1040 ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend),1041 rc = VERR_INVALID_PARAMETER);1042 AssertMsgBreak (VALID_PTR(pszFilename) && *pszFilename,1043 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename),1044 rc = VERR_INVALID_PARAMETER);1045 AssertMsgBreak ((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0,1046 ("uOpenFlags=%#x\n", uOpenFlags),1047 rc = VERR_INVALID_PARAMETER);1039 AssertMsgBreakStmt(VALID_PTR(pszBackend) && *pszBackend, 1040 ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 1041 rc = VERR_INVALID_PARAMETER); 1042 AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 1043 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 1044 rc = VERR_INVALID_PARAMETER); 1045 AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 1046 ("uOpenFlags=%#x\n", uOpenFlags), 1047 rc = VERR_INVALID_PARAMETER); 1048 1048 1049 1049 /* Force readonly for images without base/diff consistency checking. */ … … 1251 1251 1252 1252 /* Check arguments. */ 1253 AssertMsgBreak (VALID_PTR(pszBackend) && *pszBackend,1254 ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend),1255 rc = VERR_INVALID_PARAMETER);1256 AssertMsgBreak (VALID_PTR(pszFilename) && *pszFilename,1257 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename),1258 rc = VERR_INVALID_PARAMETER);1259 AssertMsgBreak (enmType == VD_IMAGE_TYPE_NORMAL || enmType == VD_IMAGE_TYPE_FIXED,1260 ("enmType=%#x\n", enmType),1261 rc = VERR_INVALID_PARAMETER);1262 AssertMsgBreak (cbSize,1263 ("cbSize=%llu\n", cbSize),1264 rc = VERR_INVALID_PARAMETER);1265 AssertMsgBreak ((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0,1266 ("uImageFlags=%#x\n", uImageFlags),1267 rc = VERR_INVALID_PARAMETER);1253 AssertMsgBreakStmt(VALID_PTR(pszBackend) && *pszBackend, 1254 ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 1255 rc = VERR_INVALID_PARAMETER); 1256 AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 1257 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 1258 rc = VERR_INVALID_PARAMETER); 1259 AssertMsgBreakStmt(enmType == VD_IMAGE_TYPE_NORMAL || enmType == VD_IMAGE_TYPE_FIXED, 1260 ("enmType=%#x\n", enmType), 1261 rc = VERR_INVALID_PARAMETER); 1262 AssertMsgBreakStmt(cbSize, 1263 ("cbSize=%llu\n", cbSize), 1264 rc = VERR_INVALID_PARAMETER); 1265 AssertMsgBreakStmt((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0, 1266 ("uImageFlags=%#x\n", uImageFlags), 1267 rc = VERR_INVALID_PARAMETER); 1268 1268 /* The PCHS geometry fields may be 0 to leave it for later. */ 1269 AssertMsgBreak ( VALID_PTR(pPCHSGeometry)1270 && pPCHSGeometry->cCylinders <= 163831271 && pPCHSGeometry->cHeads <= 161272 && pPCHSGeometry->cSectors <= 63,1273 ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry,1274 pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads,1275 pPCHSGeometry->cSectors),1276 rc = VERR_INVALID_PARAMETER);1269 AssertMsgBreakStmt( VALID_PTR(pPCHSGeometry) 1270 && pPCHSGeometry->cCylinders <= 16383 1271 && pPCHSGeometry->cHeads <= 16 1272 && pPCHSGeometry->cSectors <= 63, 1273 ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry, 1274 pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, 1275 pPCHSGeometry->cSectors), 1276 rc = VERR_INVALID_PARAMETER); 1277 1277 /* The LCHS geometry fields may be 0 to leave it to later autodetection. */ 1278 AssertMsgBreak ( VALID_PTR(pLCHSGeometry)1279 && pLCHSGeometry->cCylinders <= 10241280 && pLCHSGeometry->cHeads <= 2551281 && pLCHSGeometry->cSectors <= 63,1282 ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry,1283 pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads,1284 pLCHSGeometry->cSectors),1285 rc = VERR_INVALID_PARAMETER);1286 AssertMsgBreak ((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0,1287 ("uOpenFlags=%#x\n", uOpenFlags),1288 rc = VERR_INVALID_PARAMETER);1278 AssertMsgBreakStmt( VALID_PTR(pLCHSGeometry) 1279 && pLCHSGeometry->cCylinders <= 1024 1280 && pLCHSGeometry->cHeads <= 255 1281 && pLCHSGeometry->cSectors <= 63, 1282 ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry, 1283 pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, 1284 pLCHSGeometry->cSectors), 1285 rc = VERR_INVALID_PARAMETER); 1286 AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 1287 ("uOpenFlags=%#x\n", uOpenFlags), 1288 rc = VERR_INVALID_PARAMETER); 1289 1289 1290 1290 /* Check state. */ 1291 AssertMsgBreak (pDisk->cImages == 0,1292 ("Create base image cannot be done with other images open\n"),1293 rc = VERR_VDI_INVALID_STATE);1291 AssertMsgBreakStmt(pDisk->cImages == 0, 1292 ("Create base image cannot be done with other images open\n"), 1293 rc = VERR_VDI_INVALID_STATE); 1294 1294 1295 1295 /* Set up image descriptor. */ … … 1444 1444 1445 1445 /* Check arguments. */ 1446 AssertMsgBreak (VALID_PTR(pszBackend) && *pszBackend,1447 ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend),1448 rc = VERR_INVALID_PARAMETER);1449 AssertMsgBreak (VALID_PTR(pszFilename) && *pszFilename,1450 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename),1451 rc = VERR_INVALID_PARAMETER);1452 AssertMsgBreak ((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0,1453 ("uImageFlags=%#x\n", uImageFlags),1454 rc = VERR_INVALID_PARAMETER);1455 AssertMsgBreak ((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0,1456 ("uOpenFlags=%#x\n", uOpenFlags),1457 rc = VERR_INVALID_PARAMETER);1446 AssertMsgBreakStmt(VALID_PTR(pszBackend) && *pszBackend, 1447 ("pszBackend=%#p \"%s\"\n", pszBackend, pszBackend), 1448 rc = VERR_INVALID_PARAMETER); 1449 AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 1450 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 1451 rc = VERR_INVALID_PARAMETER); 1452 AssertMsgBreakStmt((uImageFlags & ~VD_IMAGE_FLAGS_MASK) == 0, 1453 ("uImageFlags=%#x\n", uImageFlags), 1454 rc = VERR_INVALID_PARAMETER); 1455 AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 1456 ("uOpenFlags=%#x\n", uOpenFlags), 1457 rc = VERR_INVALID_PARAMETER); 1458 1458 1459 1459 /* Check state. */ 1460 AssertMsgBreak (pDisk->cImages != 0,1461 ("Create diff image cannot be done without other images open\n"),1462 rc = VERR_VDI_INVALID_STATE);1460 AssertMsgBreakStmt(pDisk->cImages != 0, 1461 ("Create diff image cannot be done without other images open\n"), 1462 rc = VERR_VDI_INVALID_STATE); 1463 1463 1464 1464 /* Set up image descriptor. */ … … 1822 1822 do { 1823 1823 /* Check arguments. */ 1824 AssertMsgBreak (VALID_PTR(pDiskFrom), ("pDiskFrom=%#p\n", pDiskFrom),1825 rc = VERR_INVALID_PARAMETER);1824 AssertMsgBreakStmt(VALID_PTR(pDiskFrom), ("pDiskFrom=%#p\n", pDiskFrom), 1825 rc = VERR_INVALID_PARAMETER); 1826 1826 AssertMsg(pDiskFrom->u32Signature == VBOXHDDDISK_SIGNATURE, 1827 1827 ("u32Signature=%08x\n", pDiskFrom->u32Signature)); … … 1829 1829 PVDIMAGE pImageFrom = vdGetImageByNumber(pDiskFrom, nImage); 1830 1830 AssertBreak(VALID_PTR(pImageFrom), rc = VERR_VDI_IMAGE_NOT_FOUND); 1831 AssertMsgBreak (VALID_PTR(pDiskTo), ("pDiskTo=%#p\n", pDiskTo),1832 rc = VERR_INVALID_PARAMETER);1831 AssertMsgBreakStmt(VALID_PTR(pDiskTo), ("pDiskTo=%#p\n", pDiskTo), 1832 rc = VERR_INVALID_PARAMETER); 1833 1833 AssertMsg(pDiskTo->u32Signature == VBOXHDDDISK_SIGNATURE, 1834 1834 ("u32Signature=%08x\n", pDiskTo->u32Signature)); … … 1887 1887 1888 1888 /* If fMoveByRename is set pszFilename is allowed to be NULL, so do the parameter check here. */ 1889 AssertMsgBreak (VALID_PTR(pszFilename) && *pszFilename,1890 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename),1891 rc = VERR_INVALID_PARAMETER);1889 AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 1890 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 1891 rc = VERR_INVALID_PARAMETER); 1892 1892 1893 1893 /* Collect properties of source image. */ … … 2193 2193 2194 2194 /* Check arguments. */ 2195 AssertMsgBreak (VALID_PTR(pvBuf),2196 ("pvBuf=%#p\n", pvBuf),2197 rc = VERR_INVALID_PARAMETER);2198 AssertMsgBreak (cbRead,2199 ("cbRead=%zu\n", cbRead),2200 rc = VERR_INVALID_PARAMETER);2201 AssertMsgBreak (uOffset + cbRead <= pDisk->cbSize,2202 ("uOffset=%llu cbRead=%zu pDisk->cbSize=%llu\n",2203 uOffset, cbRead, pDisk->cbSize),2204 rc = VERR_INVALID_PARAMETER);2195 AssertMsgBreakStmt(VALID_PTR(pvBuf), 2196 ("pvBuf=%#p\n", pvBuf), 2197 rc = VERR_INVALID_PARAMETER); 2198 AssertMsgBreakStmt(cbRead, 2199 ("cbRead=%zu\n", cbRead), 2200 rc = VERR_INVALID_PARAMETER); 2201 AssertMsgBreakStmt(uOffset + cbRead <= pDisk->cbSize, 2202 ("uOffset=%llu cbRead=%zu pDisk->cbSize=%llu\n", 2203 uOffset, cbRead, pDisk->cbSize), 2204 rc = VERR_INVALID_PARAMETER); 2205 2205 2206 2206 PVDIMAGE pImage = pDisk->pLast; … … 2238 2238 2239 2239 /* Check arguments. */ 2240 AssertMsgBreak (VALID_PTR(pvBuf),2241 ("pvBuf=%#p\n", pvBuf),2242 rc = VERR_INVALID_PARAMETER);2243 AssertMsgBreak (cbWrite,2244 ("cbWrite=%zu\n", cbWrite),2245 rc = VERR_INVALID_PARAMETER);2246 AssertMsgBreak (uOffset + cbWrite <= pDisk->cbSize,2247 ("uOffset=%llu cbWrite=%zu pDisk->cbSize=%llu\n",2248 uOffset, cbWrite, pDisk->cbSize),2249 rc = VERR_INVALID_PARAMETER);2240 AssertMsgBreakStmt(VALID_PTR(pvBuf), 2241 ("pvBuf=%#p\n", pvBuf), 2242 rc = VERR_INVALID_PARAMETER); 2243 AssertMsgBreakStmt(cbWrite, 2244 ("cbWrite=%zu\n", cbWrite), 2245 rc = VERR_INVALID_PARAMETER); 2246 AssertMsgBreakStmt(uOffset + cbWrite <= pDisk->cbSize, 2247 ("uOffset=%llu cbWrite=%zu pDisk->cbSize=%llu\n", 2248 uOffset, cbWrite, pDisk->cbSize), 2249 rc = VERR_INVALID_PARAMETER); 2250 2250 2251 2251 PVDIMAGE pImage = pDisk->pLast; … … 2423 2423 2424 2424 /* Check arguments. */ 2425 AssertMsgBreak (VALID_PTR(pPCHSGeometry),2426 ("pPCHSGeometry=%#p\n", pPCHSGeometry),2427 rc = VERR_INVALID_PARAMETER);2425 AssertMsgBreakStmt(VALID_PTR(pPCHSGeometry), 2426 ("pPCHSGeometry=%#p\n", pPCHSGeometry), 2427 rc = VERR_INVALID_PARAMETER); 2428 2428 2429 2429 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2476 2476 2477 2477 /* Check arguments. */ 2478 AssertMsgBreak ( VALID_PTR(pPCHSGeometry)2479 && pPCHSGeometry->cCylinders <= 163832480 && pPCHSGeometry->cHeads <= 162481 && pPCHSGeometry->cSectors <= 63,2482 ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry,2483 pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads,2484 pPCHSGeometry->cSectors),2485 rc = VERR_INVALID_PARAMETER);2478 AssertMsgBreakStmt( VALID_PTR(pPCHSGeometry) 2479 && pPCHSGeometry->cCylinders <= 16383 2480 && pPCHSGeometry->cHeads <= 16 2481 && pPCHSGeometry->cSectors <= 63, 2482 ("pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pPCHSGeometry, 2483 pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, 2484 pPCHSGeometry->cSectors), 2485 rc = VERR_INVALID_PARAMETER); 2486 2486 2487 2487 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2569 2569 2570 2570 /* Check arguments. */ 2571 AssertMsgBreak (VALID_PTR(pLCHSGeometry),2572 ("pLCHSGeometry=%#p\n", pLCHSGeometry),2573 rc = VERR_INVALID_PARAMETER);2571 AssertMsgBreakStmt(VALID_PTR(pLCHSGeometry), 2572 ("pLCHSGeometry=%#p\n", pLCHSGeometry), 2573 rc = VERR_INVALID_PARAMETER); 2574 2574 2575 2575 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2622 2622 2623 2623 /* Check arguments. */ 2624 AssertMsgBreak ( VALID_PTR(pLCHSGeometry)2625 && pLCHSGeometry->cCylinders <= 10242626 && pLCHSGeometry->cHeads <= 2552627 && pLCHSGeometry->cSectors <= 63,2628 ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry,2629 pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads,2630 pLCHSGeometry->cSectors),2631 rc = VERR_INVALID_PARAMETER);2624 AssertMsgBreakStmt( VALID_PTR(pLCHSGeometry) 2625 && pLCHSGeometry->cCylinders <= 1024 2626 && pLCHSGeometry->cHeads <= 255 2627 && pLCHSGeometry->cSectors <= 63, 2628 ("pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pLCHSGeometry, 2629 pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, 2630 pLCHSGeometry->cSectors), 2631 rc = VERR_INVALID_PARAMETER); 2632 2632 2633 2633 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2714 2714 2715 2715 /* Check arguments. */ 2716 AssertMsgBreak (VALID_PTR(puVersion),2717 ("puVersion=%#p\n", puVersion),2718 rc = VERR_INVALID_PARAMETER);2716 AssertMsgBreakStmt(VALID_PTR(puVersion), 2717 ("puVersion=%#p\n", puVersion), 2718 rc = VERR_INVALID_PARAMETER); 2719 2719 2720 2720 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2751 2751 2752 2752 /* Check arguments. */ 2753 AssertMsgBreak (VALID_PTR(penmType),2754 ("penmType=%#p\n", penmType),2755 rc = VERR_INVALID_PARAMETER);2753 AssertMsgBreakStmt(VALID_PTR(penmType), 2754 ("penmType=%#p\n", penmType), 2755 rc = VERR_INVALID_PARAMETER); 2756 2756 2757 2757 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2789 2789 2790 2790 /* Check arguments. */ 2791 AssertMsgBreak (VALID_PTR(puImageFlags),2792 ("puImageFlags=%#p\n", puImageFlags),2793 rc = VERR_INVALID_PARAMETER);2791 AssertMsgBreakStmt(VALID_PTR(puImageFlags), 2792 ("puImageFlags=%#p\n", puImageFlags), 2793 rc = VERR_INVALID_PARAMETER); 2794 2794 2795 2795 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2826 2826 2827 2827 /* Check arguments. */ 2828 AssertMsgBreak (VALID_PTR(puOpenFlags),2829 ("puOpenFlags=%#p\n", puOpenFlags),2830 rc = VERR_INVALID_PARAMETER);2828 AssertMsgBreakStmt(VALID_PTR(puOpenFlags), 2829 ("puOpenFlags=%#p\n", puOpenFlags), 2830 rc = VERR_INVALID_PARAMETER); 2831 2831 2832 2832 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2864 2864 2865 2865 /* Check arguments. */ 2866 AssertMsgBreak ((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0,2867 ("uOpenFlags=%#x\n", uOpenFlags),2868 rc = VERR_INVALID_PARAMETER);2866 AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, 2867 ("uOpenFlags=%#x\n", uOpenFlags), 2868 rc = VERR_INVALID_PARAMETER); 2869 2869 2870 2870 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2906 2906 2907 2907 /* Check arguments. */ 2908 AssertMsgBreak (VALID_PTR(pszFilename) && *pszFilename,2909 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename),2910 rc = VERR_INVALID_PARAMETER);2911 AssertMsgBreak (cbFilename,2912 ("cbFilename=%u\n", cbFilename),2913 rc = VERR_INVALID_PARAMETER);2908 AssertMsgBreakStmt(VALID_PTR(pszFilename) && *pszFilename, 2909 ("pszFilename=%#p \"%s\"\n", pszFilename, pszFilename), 2910 rc = VERR_INVALID_PARAMETER); 2911 AssertMsgBreakStmt(cbFilename, 2912 ("cbFilename=%u\n", cbFilename), 2913 rc = VERR_INVALID_PARAMETER); 2914 2914 2915 2915 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 2959 2959 2960 2960 /* Check arguments. */ 2961 AssertMsgBreak (VALID_PTR(pszComment),2962 ("pszComment=%#p \"%s\"\n", pszComment, pszComment),2963 rc = VERR_INVALID_PARAMETER);2964 AssertMsgBreak (cbComment,2965 ("cbComment=%u\n", cbComment),2966 rc = VERR_INVALID_PARAMETER);2961 AssertMsgBreakStmt(VALID_PTR(pszComment), 2962 ("pszComment=%#p \"%s\"\n", pszComment, pszComment), 2963 rc = VERR_INVALID_PARAMETER); 2964 AssertMsgBreakStmt(cbComment, 2965 ("cbComment=%u\n", cbComment), 2966 rc = VERR_INVALID_PARAMETER); 2967 2967 2968 2968 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3000 3000 3001 3001 /* Check arguments. */ 3002 AssertMsgBreak (VALID_PTR(pszComment) || pszComment == NULL,3003 ("pszComment=%#p \"%s\"\n", pszComment, pszComment),3004 rc = VERR_INVALID_PARAMETER);3002 AssertMsgBreakStmt(VALID_PTR(pszComment) || pszComment == NULL, 3003 ("pszComment=%#p \"%s\"\n", pszComment, pszComment), 3004 rc = VERR_INVALID_PARAMETER); 3005 3005 3006 3006 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3036 3036 3037 3037 /* Check arguments. */ 3038 AssertMsgBreak (VALID_PTR(pUuid),3039 ("pUuid=%#p\n", pUuid),3040 rc = VERR_INVALID_PARAMETER);3038 AssertMsgBreakStmt(VALID_PTR(pUuid), 3039 ("pUuid=%#p\n", pUuid), 3040 rc = VERR_INVALID_PARAMETER); 3041 3041 3042 3042 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3071 3071 AssertMsg(pDisk->u32Signature == VBOXHDDDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 3072 3072 3073 AssertMsgBreak (VALID_PTR(pUuid) || pUuid == NULL,3074 ("pUuid=%#p\n", pUuid),3075 rc = VERR_INVALID_PARAMETER);3073 AssertMsgBreakStmt(VALID_PTR(pUuid) || pUuid == NULL, 3074 ("pUuid=%#p\n", pUuid), 3075 rc = VERR_INVALID_PARAMETER); 3076 3076 3077 3077 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3112 3112 3113 3113 /* Check arguments. */ 3114 AssertMsgBreak (VALID_PTR(pUuid),3115 ("pUuid=%#p\n", pUuid),3116 rc = VERR_INVALID_PARAMETER);3114 AssertMsgBreakStmt(VALID_PTR(pUuid), 3115 ("pUuid=%#p\n", pUuid), 3116 rc = VERR_INVALID_PARAMETER); 3117 3117 3118 3118 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3149 3149 3150 3150 /* Check arguments. */ 3151 AssertMsgBreak (VALID_PTR(pUuid) || pUuid == NULL,3152 ("pUuid=%#p\n", pUuid),3153 rc = VERR_INVALID_PARAMETER);3151 AssertMsgBreakStmt(VALID_PTR(pUuid) || pUuid == NULL, 3152 ("pUuid=%#p\n", pUuid), 3153 rc = VERR_INVALID_PARAMETER); 3154 3154 3155 3155 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3192 3192 3193 3193 /* Check arguments. */ 3194 AssertMsgBreak (VALID_PTR(pUuid),3195 ("pUuid=%#p\n", pUuid),3196 rc = VERR_INVALID_PARAMETER);3194 AssertMsgBreakStmt(VALID_PTR(pUuid), 3195 ("pUuid=%#p\n", pUuid), 3196 rc = VERR_INVALID_PARAMETER); 3197 3197 3198 3198 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage); … … 3228 3228 3229 3229 /* Check arguments. */ 3230 AssertMsgBreak (VALID_PTR(pUuid) || pUuid == NULL,3231 ("pUuid=%#p\n", pUuid),3232 rc = VERR_INVALID_PARAMETER);3230 AssertMsgBreakStmt(VALID_PTR(pUuid) || pUuid == NULL, 3231 ("pUuid=%#p\n", pUuid), 3232 rc = VERR_INVALID_PARAMETER); 3233 3233 3234 3234 PVDIMAGE pImage = vdGetImageByNumber(pDisk, nImage);
Note:
See TracChangeset
for help on using the changeset viewer.