Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
379 Beiträge
 
#5

AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11

  Alt 14. Jan 2025, 11:11
Here extra info to whom may it interest and belongs to a research i did few years back,

This API does return the constant naming as it defined in Windows SDK/DDK, not all shown as many are hidden behind different masks, which does show that accessing these API usually does need some sort of macros, even the API is not documented and not even named !
Delphi-Quellcode:
{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,
  Windows;

function cacert_873(bufferi: Pointer; bufferlen: Integer; errorcode: cardinal): HRESULT; stdcall; external 'certca.dllindex 873;

function ConstantNameFromErrorCode(ErrCode: Cardinal): string;
begin
  SetLength(Result, 64);
  ZeroMemory(@Result[1], Length(Result) * SizeOf(Char));
  cacert_873(@Result[1], Length(Result), ErrCode);
end;

procedure Resolve(ErrCode: Cardinal);
begin
  Writeln(IntToStr(ErrCode) + #9 + ConstantNameFromErrorCode(ErrCode));
end;

procedure DoRangeDump;
var
  i: Integer;
begin
  for i := 3000 to 3026 do
    Resolve(i);
end;

begin
  Resolve(0);
  Resolve(1);
  DoRangeDump;
  Resolve(3181); // this one does exist but not reported https://github.com/tpn/winddk-8.1/blob/master/Include/um/LMErrlog.h#L449
  Readln;
end.
The result on my Windows 10
Zitat:
1 0x1 (WIN32: 1 ERROR_INVALID_FUNCTION)
3000 0xbb8 (WIN32: 3000 ERROR_UNKNOWN_PRINT_MONITOR)
3001 0xbb9 (WIN32: 3001 ERROR_PRINTER_DRIVER_IN_USE)
3002 0xbba (WIN32: 3002 ERROR_SPOOL_FILE_NOT_FOUND)
3003 0xbbb (WIN32: 3003 ERROR_SPL_NO_STARTDOC)
3004 0xbbc (WIN32: 3004 ERROR_SPL_NO_ADDJOB)
3005 0xbbd (WIN32: 3005 ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED)
3006 0xbbe (WIN32: 3006 ERROR_PRINT_MONITOR_ALREADY_INSTALLED)
3007 0xbbf (WIN32: 3007 ERROR_INVALID_PRINT_MONITOR)
3008 0xbc0 (WIN32: 3008 ERROR_PRINT_MONITOR_IN_USE)
3009 0xbc1 (WIN32: 3009 ERROR_PRINTER_HAS_JOBS_QUEUED)
3010 0xbc2 (WIN32: 3010 ERROR_SUCCESS_REBOOT_REQUIRED)
3011 0xbc3 (WIN32: 3011 ERROR_SUCCESS_RESTART_REQUIRED)
3012 0xbc4 (WIN32: 3012 ERROR_PRINTER_NOT_FOUND)
3013 0xbc5 (WIN32: 3013 ERROR_PRINTER_DRIVER_WARNED)
3014 0xbc6 (WIN32: 3014 ERROR_PRINTER_DRIVER_BLOCKED)
3015 0xbc7 (WIN32: 3015 ERROR_PRINTER_DRIVER_PACKAGE_IN_USE)
3016 0xbc8 (WIN32: 3016 ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND)
3017 0xbc9 (WIN32: 3017 ERROR_FAIL_REBOOT_REQUIRED)
3018 0xbca (WIN32: 3018 ERROR_FAIL_REBOOT_INITIATED)
3019 0xbcb (WIN32: 3019 ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED)
3020 0xbcc (WIN32: 3020 ERROR_PRINT_JOB_RESTART_REQUIRED)
3021 0xbcd (WIN32: 3021 ERROR_INVALID_PRINTER_DRIVER_MANIFEST)
3022 0xbce (WIN32: 3022 ERROR_PRINTER_NOT_SHAREABLE)
3023 0xbcf (WIN32: 3023)
3024 0xbd0 (WIN32: 3024)
3025 0xbd1 (WIN32: 3025)
3026 0xbd2 (WIN32: 3026)
3181 0xc6d (WIN32: 3181)
Kas
  Mit Zitat antworten Zitat