| 1 | #include <stdio.h>
|
|---|
| 2 | #include <VBox/vd.h>
|
|---|
| 3 | #include <VBox/err.h>
|
|---|
| 4 | #include <VBox/sup.h>
|
|---|
| 5 | #include <VBox/log.h>
|
|---|
| 6 | #include <iprt/alloc.h>
|
|---|
| 7 | #include <iprt/assert.h>
|
|---|
| 8 | #include <iprt/uuid.h>
|
|---|
| 9 | #include <iprt/file.h>
|
|---|
| 10 | #include <iprt/string.h>
|
|---|
| 11 | #include <iprt/asm.h>
|
|---|
| 12 | #include <iprt/ldr.h>
|
|---|
| 13 | #include <iprt/dir.h>
|
|---|
| 14 | #include <iprt/path.h>
|
|---|
| 15 | #include <iprt/param.h>
|
|---|
| 16 | #include <iprt/memcache.h>
|
|---|
| 17 | #include <iprt/sg.h>
|
|---|
| 18 | #include <iprt/list.h>
|
|---|
| 19 | #include <iprt/avl.h>
|
|---|
| 20 | #include <iprt/semaphore.h>
|
|---|
| 21 | #include <VBox/vd-plugin.h>
|
|---|
| 22 |
|
|---|
| 23 | /**
|
|---|
| 24 | * Returns the image backend descriptor matching the given identifier if known.
|
|---|
| 25 | *
|
|---|
| 26 | * @returns VBox status code.
|
|---|
| 27 | * @param pszBackend The backend identifier to look for.
|
|---|
| 28 | * @param ppBackend Where to store the pointer to the backend descriptor on success.
|
|---|
| 29 | */
|
|---|
| 30 | DECLHIDDEN(int) vdFindImageBackend(const char *pszBackend, PCVDIMAGEBACKEND *ppBackend)
|
|---|
| 31 | {
|
|---|
| 32 | int rc = VINF_SUCCESS;
|
|---|
| 33 | PCVDIMAGEBACKEND pBackend = NULL;
|
|---|
| 34 | /*
|
|---|
| 35 | if and for blocks were here before.
|
|---|
| 36 | }*/
|
|---|
| 37 | *ppBackend = pBackend;
|
|---|
| 38 | return rc;
|
|---|
| 39 | }
|
|---|
| 40 | int main(){
|
|---|
| 41 | int rc = 0xff;
|
|---|
| 42 | const char *pszBackend = "AA";
|
|---|
| 43 | PCVDIMAGEBACKEND pBackend = NULL;
|
|---|
| 44 | rc = vdFindImageBackend(pszBackend, &pBackend);
|
|---|
| 45 | if (RT_SUCCESS(rc))
|
|---|
| 46 | {
|
|---|
| 47 | if (pBackend->pfnRepair)
|
|---|
| 48 | printf("It wont reach here!\n");
|
|---|
| 49 | else
|
|---|
| 50 | rc = VERR_VD_IMAGE_REPAIR_NOT_SUPPORTED;
|
|---|
| 51 | }
|
|---|
| 52 | return 0;
|
|---|
| 53 | }
|
|---|