[C#] Calling An Office DLL Help

Discussion in 'Mixed Languages' started by CODYQX4, Dec 7, 2010.

  1. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #1 CODYQX4, Dec 7, 2010
    Last edited: Apr 15, 2019
    .
     
  2. Daz

    Daz MDL Developer / Admin
    Staff Member

    Jul 31, 2009
    9,534
    67,254
    300
    #2 Daz, Dec 7, 2010
    Last edited by a moderator: Apr 20, 2017
    Looked into the DLL before, only a little but I wasn't able to figure out the calls being made. Just for example it could be:
    Code:
    BOOL GetApplicationInformation(
    __inLPCTSTR lpAppID,
    __inDWORD dwType,
    __outLPTSTR lpBuffer
    );
    I'm not sure if anyones put any time trying to find out the API function calls but without these it's a dead end.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #3 CODYQX4, Dec 7, 2010
    Last edited: Apr 15, 2019
    (OP)
    .
     
  4. Daz

    Daz MDL Developer / Admin
    Staff Member

    Jul 31, 2009
    9,534
    67,254
    300
    #4 Daz, Dec 7, 2010
    Last edited: Dec 7, 2010
    It could result in a few hours of trial and error testing. If you get close the error codes for the function call will start changing too.

    That example actually has an issue. Its return type would likely be DWORD so that you know how much info was returned... Then again theres a ton of ways a function could be wrote and I'm tired anyway :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    How could this be used in IORRT if I never check rearms. Would this be a way to see if IORRT would work based on if it had say 0 rearms it would return a error msg? Is that what you mean?
     
  6. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #6 CODYQX4, Dec 7, 2010
    Last edited: Apr 15, 2019
    (OP)
    .
     
  7. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #7 CODYQX4, Dec 11, 2010
    Last edited: Apr 15, 2019
    (OP)
    .
     
  8. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #8 CODYQX4, Jul 24, 2012
    Last edited: Apr 12, 2019
    (OP)
    .
     
  9. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    815
    10
  10. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #10 CODYQX4, Jul 26, 2012
    Last edited: Apr 12, 2019
    (OP)
    .
     
  11. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    815
    10
    Had a look at OSPPREARM.EXE to see if SLGetApplicationInformation is used to return rearm
    count. It seems SLGetApplicationInformation is not called see code below, maybe upload ospprun.exe?.

    push eax
    CALL SLOpen

    PUSH EAX ; /Arg2
    PUSH 2D591190 ; |Arg1 = UNICODE "{59a52881-a989-479d-af46-f275c6370663}"
    CALL ole32.CLSIDFromString

    PUSH EBX
    PUSH EBX
    LEA EAX,[EBP-14]
    PUSH EAX
    PUSH DWORD PTR SS:[EBP-18]
    CALL SLReArm

    SLReArm stack
    Address Value ASCII Comments
    0036FEB4 /003F6CB8 hSLC
    0036FEB8 |0036FED4 pApplicationId 16 byte return by CLSIDFromString
    0036FEBC |00000000 pProductSkuId
    0036FEC0 |00000000 dwFlags

    PUSH DWORD PTR SS:[EBP-18]
    CALL SLClose
     
  12. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #12 CODYQX4, Jul 27, 2012
    Last edited: Apr 12, 2019
    (OP)
    .
     
  13. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #13 CODYQX4, May 2, 2013
    Last edited: Apr 12, 2019
    (OP)
    .
     
  14. PAYMYRENT

    PAYMYRENT MDL Developer

    Jul 28, 2009
    1,460
    420
    60
    try SLOpen_0 for your entry point
     
  15. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #15 CODYQX4, May 3, 2013
    Last edited: Apr 12, 2019
    (OP)
    .
     
  16. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #16 CODYQX4, May 3, 2013
    Last edited: Apr 12, 2019
    (OP)
    .
     
  17. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #17 CODYQX4, May 3, 2013
    Last edited: Apr 12, 2019
    (OP)
    .
     
  18. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #18 CODYQX4, May 3, 2013
    Last edited: Apr 12, 2019
    (OP)
    .
     
  19. deagles

    deagles MDL Developer

    Feb 22, 2013
    239
    1,174
    10
    #19 deagles, May 3, 2013
    Last edited by a moderator: Apr 20, 2017
    Code:
    byte[] descBuffer = new byte[4];
    
    GetApplicationInformation allocates a buffer itself.
    You only need a 32bit unsigned int pointer.
    ( descSize == 4 bytes )

    What does GetApplicationInformation return?
    ( 0x80070057 == One or more arguments are not valid. )
     
  20. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #20 CODYQX4, May 3, 2013
    Last edited: Apr 12, 2019
    (OP)
    .