Calling LoadDrivers for a 64 bit application there is an "Acces violation error". The error is caused by the IconsToStream procedure. Specifically, it is the use of the CopyMemory procedure:
Cardinal type was used and NativeUInt should have been used.
After the replacement, the code works correctly.