![]() |
Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Guten Morgen,
auf einem frisch installierten Windows 11 Rechner mit Delphi 12, erzeugt folgender Code ein ungültiges Handle:
Delphi-Quellcode:
SendSlotHandle ist jeweils Invalid_Handle_Value, egal ob 32 oder 64bit Compilat.
SlotName := '\\*\mailslot\MyPipeSlot';
StrPCopy (NullStr, SlotName); SendSlotHandle := CreateFile(NullStr, Generic_Write, File_Share_Read, nil, Open_Existing, File_Attribute_Normal, 0); if SendSlotHandle = Invalid_Handle_Value then begin Res := GetLastError; end; GetLastError sagt, 3025. Zu diesem Code finde ich gar nichts bei Microsoft. Das ganze funktioniert unter Windows 10 auf einem anderen Rechner ohne Probleme. Beide Rechner im gleichen Netzwerk, unterschiedlicher Computername, andere IP, gleiche Arbeitsgruppe. Jemand eine Idee, warum das Handle unter Windows 11 immer ungültig ist? Edit: Auch mit Angabe von SecurityAttributes anstatt dem "Nil", wird jeweils ein ungültiges Handle zurück geliefert Edit2: Habe jetzt doch was gefunden, hier: ![]() Ist ein veraltetes Feature und wurde deaktiviert, deswegen der Fehler. |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Good morning,
Try
Delphi-Quellcode:
SendSlotHandle := CreateFile(PWideChar(SlotName),
These i don't understand !!
Delphi-Quellcode:
NullStr
StrPCopy(NullStr, SlotName); |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
You are right but this wasn't my question.
There is no different to use my string methode or your for the Handle-Problem with Mailslot and Windows 11 |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Zitat:
Anyways, the error code 3025 is not documented, and this happened in the past many times with MSDN, also Error COdes do evolve with Windows OS per version and in many times per update ! So you should try to use this to get the real name/message for the error
Delphi-Quellcode:
But be careful here !!
Writeln('---- ' + IntToStr(3022));
Writeln(SysErrorMessage(3022)); Writeln('---- ' + IntToStr(3023)); Writeln(SysErrorMessage(3023)); Writeln('---- ' + IntToStr(3024)); Writeln(SysErrorMessage(3024)); Writeln('---- ' + IntToStr(3025)); Writeln(SysErrorMessage(3025)); Writeln('---- ' + IntToStr(3026)); Writeln(SysErrorMessage(3026)); These windows API, that handle errors attached names are well defined for existing ones but have unknown result for non documented ones, as example this error code 3025 on my Windows 10 will return the following Zitat:
![]() Now to the others and because the according API is built in away that separate ranges by masking and it is really complex, it does return incorrect for the undefined, to be exact : the message Zitat:
![]() This what i meant by these API(s) handle error code and status code as one input and they do juggling with the values/ranges, so for non existed value they will return undefined like this very case. Now to your exact problem, which i can't say for sure but i use different logic: 1) Error Codes like Status Codes, are grouped in ranges when they are belongs to one category. 2) That error code 3025 are very close to the one existed in Windows 10 (3022), 3) i can deduce it has something to do with printer or printer driver, so that very generic name for pipe you are using could be already in use on Windows 11 for a printer. suggestions: 1) Get the error message from Windows 11. 2) Just use different name or find what driver is involved if the hypotheses above stand. 3) Your application on Windows 11 is running with limited privileges for some reason and not allowed to handle pipes, notice you are using CreateFile with Open_Existing, have you tried to switch to OpenFile instead of CreateFile. 4) You might want to remove File_Attribute_Normal, yes it is said as default in documentation, but the MSDN doesn't it all, use 0 instead any attribute and let it do its thing, notice in every MSDN example for NamedPipe the attribute is always 0 (none). Hope that helps. |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 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:
The result on my Windows 10
{$APPTYPE CONSOLE}
{$R *.res} uses System.SysUtils, Windows; function cacert_873(bufferi: Pointer; bufferlen: Integer; errorcode: cardinal): HRESULT; stdcall; external 'certca.dll' index 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. Zitat:
|
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
On Windows 11, i got following message with this code:
Delphi-Quellcode:
'Fehler beim angeforderten Vorgang. Remotemailslots sind veraltet'
SysErrorMessage(3025)
So, see my edit2 of first message in this thread. Microsoft deactivate this feature and this was the reason, why it doesn't work anymore. |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Zitat:
Could you please share the rest of the missing codes ? Zitat:
|
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Searched for NamedPipes and Printing and found this
![]() Might solve your problem. |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Of course, here the other codes:
SysErrorMessage(3023) -> 'Für die angeforderte Funktion muss SMB1 vorhanden und aktiviert sein' SysErrorMessage(3024) -> 'Der Benutzer hat die Authentifizierungsaufforderung an einen Remoteserver abgebrochen' SysErrorMessage(3025) -> 'Fehler beim angeforderten Vorgang. Remotemailslots sind veraltet' SysErrorMessage(3026) -> 'Auf einem HPFS-Volume im Laufwerk %1 ist ein Datenträgerfehler aufgetreten,'#$D#$A'während eine Remoteanfrage bearbeitet wurde' SysErrorMessage(3181) -> 'Ein fehlerhafter Sektor auf Laufwerk %1 wurde ersetzt (Hotfix).'#$D#$A'Es traten keine Datenverluste auf. Sie sollten CHKDSK ausführen, um die volle'#$D#$A'Leistung wiederherzustellen und den Ersatzsektorpool des Volumes aufzufüllen.'#$D#$A#$D#$A'Hotfix ist aufgetreten, während eine Remoteanforderung bearbeitet wurde' |
AW: Probleme mit NamedPipe/Mailslot nach Umstieg auf Windows 11
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:42 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz