Proper marshalling recursive struct? menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Proper marshalling recursive struct?

    So I have cpp struct that look like this:

    Code:
    typedef struct TESTSTRUCT {
      int Something;
      int SomethingElse;
      struct TESTSTRUCT *Test;
    };
    And I need to marshal it to my c# app. So far I came with this:

    Code:
    [StructLayout( LayoutKind.Sequential )]
    public struct TestStruct {
        public int Something;
        public int SomethingElse;
        public IntPtr Test;
    }
    This works, however its imo very bad solution, because I need to run through everything and marshal it manually. Is there any way to automatically marshal whole struct?

    Proper marshalling recursive struct?
  2. #2
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uhhhh.. a little more information would be helpful.

    Are you marshalling TO something, or FROM something?

  3. #3
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm getting it from "ref" parameter. I'm trying to create my own debugging class under .net using windows debug functions like WaitForDebugEvent and this function returns DEBUG_EVENT structure wich can contain EXCEPTION_DEBUG_INFO with EXCEPTION_RECORD - and this can contain pointer to another EXCEPTION_RECORD as ExceptionRecord (inner exception). So far, I came out only with using Marshal.PtrToStructure while ExceptionRecord is valid.

Similar Threads

  1. Grand Marshal's Staff > Thundefury? <3<3<3
    By Vincent in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 12-15-2006, 07:35 PM
  2. Req: Grand Marshal Sword
    By Nivv123 in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 11-30-2006, 01:44 PM
  3. Guide to Proper Scamming
    By Datonking in forum World of Warcraft Guides
    Replies: 1
    Last Post: 10-03-2006, 07:07 PM
  4. Do u like MMA(mixed Marshal ART)
    By LightWave in forum Community Chat
    Replies: 3
    Last Post: 09-05-2006, 06:47 AM
  5. 2x Grand marshal's longsword please :)
    By Opey in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 08-29-2006, 09:17 PM
All times are GMT -5. The time now is 11:00 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search