1. Hugo Moors
  2. PowerBuilder
  3. Wednesday, 21 September 2022 08:46 AM UTC

My company wants to start using managed laptops (InTune) (Windows 10)

I've had to change the login procedure of my applications to no longer use trustedconnections as those laptops are no longer in the local AD of the databases.

I'm having an issue with my applications just stopping.

I've regenerated, optimized, exported/imported I've even changed PB versions from 2019 to 2021 to 2022 but I'm always having this issue of the application stopping at a certain point on the InTune laptop and working as it should on our normal laptop.

The EXE, ini, xml and PB runtime files on both laptops are identical.

In debug PowerBuilder IDE (2019 R3 2703 same as the application, fresh install on both laptops) crashes on the InTune laptop when I reach the point where the application stops (simply setting a dataobject on a datastore)

In the PBDEBUG log there are some minor version differences in the windows system DLLs and order of when they load, the normal laptop seems to load more but the InTune is also loading some things that the other one doesn't like ATL100.dll the application starts and runs exactly the same until one stops still in the open event of the application (after a database login) and on the other laptop it just goes on.
This is a smallish application 4 pbl no PFC

In the PBDEBUG compare screenshots the InTune is on the left red is what the InTune loads extra (green on the right is what the other laptop loads extra)

Not really sure what I'm expecting here, seems like a very specific situation, maybe someone has the golden tip for some other test I can do as I'm really running out of ideas. And I do have other larger PFC application that need to get this change too.

I've tried newer PB versions with similar results (the crash points are sometimes different)

Attachments (2)
Accepted Answer
Hugo Moors Accepted Answer Pending Moderation
  1. Wednesday, 21 September 2022 18:34 PM UTC
  2. PowerBuilder
  3. # Permalink

I think I've found it, it seems to be linked to calling windows DLL GetUserNameExA in SECUR32.DLL when I call it things don't immediately go wrong but eventually I'll get a crash in the next few lines or at least at the close of the application in debug it will crash and take the PB IDE with it (which points to something not being 100% in memory)

I've changed it to the non ANSI version GetUserNameExW and things seem to be working now!
Thanks for all the hints, gonna log off now :-)
Comment
  1. Armeen Mazda @Appeon
  2. Wednesday, 21 September 2022 22:14 PM UTC
Thanks for sharing the solution and glad to hear it is resolved!
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 21 September 2022 14:32 PM UTC
  2. PowerBuilder
  3. # 1

Hi Hugo;

  I would suggest using PB2022 for your App. This new release is based on a a much newer C++ compiler and does not use the " ATL100.dll" (for example) or other very old Microsoft runtime DLLs. Just a thought.

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 21 September 2022 18:38 PM UTC
Hi Hugo;

Since Appon PB is no longer ANSI but UNICODE based, try this instead...

FUNCTION Boolean GetUserNameEx ( Integer nameformat, ref string username, ref Integer namelen ) LIBRARY "Secur32.dll" ALIAS FOR "GetUserNameExW"



Also, since A) User Names can be up to 255 characters and B) arguments are passed by REF...

li_size = 256 // Max name size (plus 1 to be safe)

ls_name = Space(256) // Before SDK call - allocate memory



HTH

Regards ... Chris
  1. Helpful 3
There are no comments made yet.
Hugo Moors Accepted Answer Pending Moderation
  1. Wednesday, 21 September 2022 13:14 PM UTC
  2. PowerBuilder
  3. # 2

I added a Try Catch clause but the application is just removed from memory without being Caught

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 21 September 2022 11:52 AM UTC
  2. PowerBuilder
  3. # 3

What happens if you comment out the code it crashes on?  Is it just that DW assignment that has problems?

Comment
  1. Hugo Moors
  2. Wednesday, 21 September 2022 13:11 PM UTC
It is so strange, I've been removing old code trying to find something

I thought I had some success when I removed an unused external function GetUserNameA (using GetUserNameExW now) but after running from the IDE ok 2 times it went back to crashing without changing anything! it really looks like there's something in the OS kicking PB out after a certain amount of time;
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 21 September 2022 14:57 PM UTC
Can you reproduce with PB 2022? Make sure all the required runtime DLLs are copied... missing runtime DLLs or mismatched version of the DLLs will blow things up.
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.