AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

from ANSI_STRING to PAnsichar

Ein Thema von mohfa · begonnen am 24. Okt 2009 · letzter Beitrag vom 25. Okt 2009
 
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#5

Re: from ANSI_STRING to PAnsichar

  Alt 25. Okt 2009, 14:03
Thank you himitsu . i think i'm confused here :

What i wanted is :

i use the ANSI_STRING in a C project declared as follows :

Code:
typedef struct _SCANNER_REPLY {

       BOOLEAN SafeToOpen;
       ANSI_STRING FileName;
} SCANNER_REPLY, *PSCANNER_REPLY;
Only to print out the Current FileName exmp : c:\mytextfile.txt

so the result in c :
Code:
NTSTATUS status;
SCANNER_REPLY replyMessage;
status = RtlUnicodeStringToAnsiString(&replyMessage.FileName, &FileI->Name, TRUE);
   
   if (NT_SUCCESS( status )) {
        DbgPrint("Current File: %s\n", replyMessage.FileName.Buffer);
/*
 this will Print Out the Current FileName ** Current File: \Device\HarddiskVolume1\myfile.txt **
*/
        RtlFreeAnsiString(&replyMessage.FileName);
      }
and in Delphi i declared as follows :
Delphi-Quellcode:
_SCANNER_REPLY = record
SafeToOpen: BOOLEAN;
FileName:ANSI_STRING ; // ANSI_STRING is declared as in my 1st thread
end;
SCANNER_REPLY = _SCANNER_REPLY;
PSCANNER_REPLY = ^_SCANNER_REPLY;
But when i used your methode in your last reply P will print out the Whole FileName content Buffer , But i only need to print out the filename as in C result

any suggestion for that ?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:15 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