============================================================================= IL_Create() Creates an ITEMIDLIST by concatenating pidl1 and pidl2 cb1 and cb2 indicate the sizes of the pidls, where cb1 can be zero and pidl1 can be NULL If cb2 is zero, the size of pidl2 is retrieved using IL_GetSize(pidl2)
| 1464 | // IL_GetSize(pidl2) |
| 1465 | // |
| 1466 | LPITEMIDLIST IL_Create(LPCITEMIDLIST pidl1,UINT cb1, |
| 1467 | LPCITEMIDLIST pidl2,UINT cb2) |
| 1468 | { |
| 1469 | |
| 1470 | LPITEMIDLIST pidl; |
| 1471 | |
| 1472 | if (!pidl2) |
| 1473 | return NULL; |
| 1474 | |
| 1475 | if (!cb2) |
| 1476 | cb2 = IL_GetSize(pidl2) + 2; // Space for terminating Bytes |
| 1477 | |
| 1478 | if (!cb1) |
| 1479 | cb1 = IL_GetSize(pidl1); |
| 1480 | |
| 1481 | // Allocate Memory |
| 1482 | pidl = CoTaskMemAlloc(cb1 + cb2); |
| 1483 | |
| 1484 | // Init new ITEMIDLIST |
| 1485 | if (pidl1) |
| 1486 | CopyMemory(pidl,pidl1,cb1); |
| 1487 | |
| 1488 | // pidl2 can't be NULL here |
| 1489 | CopyMemory((LPBYTE)pidl + cb1,pidl2,cb2); |
| 1490 | |
| 1491 | return pidl; |
| 1492 | |
| 1493 | } |
| 1494 | |
| 1495 | |
| 1496 | //============================================================================= |
no test coverage detected