Try this sequence for the HP LaserJet 6p on Windows 10:
- Update or reinstall the printer driver.
- Open Start > Device Manager.
- Expand Printers.
- Right-click the HP printer and select Update driver.
- If no update is available, select Uninstall device, then restart the PC so Windows can try to reinstall the driver automatically.
- If Windows still cannot use a suitable driver, install a compatible driver from the printer manufacturer.
- Download a driver that matches Windows 10 and the correct 32-bit or 64-bit system type.
- Install the driver and restart the PC.
- Avoid drivers marked for older or unsupported Windows versions unless no newer driver is available.
- Remove and reinstall the printer.
- Go to Start > Settings > Devices > Printers & scanners.
- Select the printer and choose Remove device.
- Restart the PC.
- Return to Printers & scanners and select Add a printer or scanner.
- If Windows does not find it automatically, use the manual install path and choose Add a local printer or network printer with manual settings.
- For a manual reinstall, specify the port and driver.
- Select Use an existing port and choose the port the printer is connected to.
- If it is USB-connected, select the USB port from the list.
- When prompted for the driver, select Windows Update or Have Disk if a manufacturer driver package is available.
- Select the printer manufacturer and model, then finish setup and print a test page.
- If printing problems continue, clear and reset the print spooler.
- Open Services from the taskbar search.
- Double-click Print Spooler and select Stop.
- Delete all files in %WINDIR%\system32\spool\PRINTERS.
- Go back to Services, open Print Spooler, select Start, set Startup type to Automatic, and select OK.
- If the problem started after a recent driver update, roll back the driver.
- Open Device Manager.
- Expand Printers or Print queues.
- Right-click the printer > Properties > Driver tab > Roll Back Driver.
- Restart the PC.
The "handle is invalid" message can be consistent with a printer driver or handle problem. In driver validation guidance, an invalid handle exception is raised when a function passes an invalid handle to a system routine, and a handle can also become invalid if it is used after it was closed.