AGB  ·  Datenschutz  ·  Impressum  







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

check this error pls

Ein Thema von user · begonnen am 10. Nov 2011 · letzter Beitrag vom 11. Nov 2011
Antwort Antwort
Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#1

AW: check this error pls

  Alt 10. Nov 2011, 11:45
Please use a Title which describes your problem. With that title, nobody knows the problem by reading it.
If somebody with the same problem will use the search, he/she will not find the result in this thread (because of the title which don't describe the problem).
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: check this error pls

  Alt 10. Nov 2011, 12:27
Und wer hat die deutschen Kommentare im Quelltext geschrieben?
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
user

Registriert seit: 13. Jul 2010
25 Beiträge
 
Delphi 2 Desktop
 
#3

AW: check this error pls

  Alt 11. Nov 2011, 07:19
@DeddyH: Yeah I will add:
Code:
if not assigned (WinVerifyTrust ) then
Thanks for the correction.

@SirThornberry: Next time I will make the title clearly.
  Mit Zitat antworten Zitat
CCRDude

Registriert seit: 9. Jun 2011
678 Beiträge
 
FreePascal / Lazarus
 
#4

AW: check this error pls

  Alt 11. Nov 2011, 08:23
That's a widely spread code sample that I've seen in many many places while looking for code to compare to find a bug in my own implementation. And like with a lot of code snippets found on the net, in the end you'll be faster if you implement it yourself.

I'll give you a hint at what to look for:

//Fake Pointer - nötig damit der Speicer wieder freigegeben wird Open up MSDN, compare the data structure, and implement this one correctly to avoid further problems (these fake pointers, where someone misunderstood what unions are, make all following fields invalid / pointing to something else than the name suggests).
  Mit Zitat antworten Zitat
user

Registriert seit: 13. Jul 2010
25 Beiträge
 
Delphi 2 Desktop
 
#5

AW: check this error pls

  Alt 11. Nov 2011, 09:29
I just searched similar function to verify file trust. I got code by Craig Peterson in StackOverflow.

Code:
type
  PWinTrustFileInfo = ^TWinTrustFileInfo;
  TWinTrustFileInfo = record
    cbStruct: DWORD;                   // = sizeof(WINTRUST_FILE_INFO)
    pcwszFilePath: PWideChar;          // required, file name to be verified
    hFile: THandle;                    // optional, open handle to pcwszFilePath
    pgKnownSubject: PGUID;             // optional: fill if the subject type is known
  end;

  PWinTrustData = ^TWinTrustData;
  TWinTrustData = record
    cbStruct: DWORD;
    pPolicyCallbackData: Pointer;
    pSIPClientData: Pointer;
    dwUIChoice: DWORD;
    fdwRevocationChecks: DWORD;
    dwUnionChoice: DWORD;
    pFile: PWinTrustFileInfo;
    dwStateAction: DWORD;
    hWVTStateData: THandle;
    pwszURLReference: PWideChar;
    dwProvFlags: DWORD;
    dwUIContext: DWORD;
  end;
MSDN say

Code:
typedef struct _WINTRUST_DATA {
  DWORD cbStruct;
  LPVOID pPolicyCallbackData;
  LPVOID pSIPClientData;
  DWORD dwUIChoice;
  DWORD fdwRevocationChecks;
  DWORD dwUnionChoice;
  union {
    struct WINTRUST_FILE_INFO_  *pFile;
    struct WINTRUST_CATALOG_INFO_  *pCatalog;
    struct WINTRUST_BLOB_INFO_  *pBlob;
    struct WINTRUST_SGNR_INFO_  *pSgnr;
    struct WINTRUST_CERT_INFO_  *pCert;
  };
  DWORD dwStateAction;
  HANDLE hWVTStateData;
  WCHAR *pwszURLReference;
  DWORD dwProvFlags;
  DWORD dwUIContext;
} WINTRUST_DATA, *PWINTRUST_DATA;
Something like that?

I also get similar function by rllibby and I'll try to compare them.
  Mit Zitat antworten Zitat
CCRDude

Registriert seit: 9. Jun 2011
678 Beiträge
 
FreePascal / Lazarus
 
#6

AW: check this error pls

  Alt 11. Nov 2011, 13:17
That structure is fine, except that pFile should be a simple Pointer, since depending on dwUnionChoice, it might be something different than PWinTrustFileInfo.

Or, instead of the simple pointer, a Delphi union.
  Mit Zitat antworten Zitat
Antwort Antwort


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 08:51 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