Discussion:
IB Test
(too old to reply)
annfitchard
2008-04-22 14:32:34 UTC
Permalink
Hello,

I have just uploaded the blat-tests.zip file. This is the first time I am
communicating in a group. If I am not doing things the right or
conventional way, please let me know.

I also downloaded namtog's IB test.zip. There are two tests. The one
close to what I am doing is the dll test. The test works when the
blat.dll is in the same folder as IB.exe. When I moved blat.dll to
C:\windows\system32, the test fails (unable to load blat.dll). I changed
the code to force it to load blat.dll from system32 folder:
blat_lib = LoadLibrary("c:\\windows\\system32\\blat.dll");
I recompiled the code (in VS2005 on Windows/vista) and ran it. The
same error was returned.

I noticed that ib.c calls functions like LoadLibrary(), GetProcAddress(),
etc. I assume that they are Microsoft specific methods. This is what
we are trying to avoid. We deploy software on platforms from solaris
to Linux to Windows, and try to write as portable code as possible.
Since blat is for Windows only. On unix/linux we have to use 'hmail'.
By invoking mail command using 'system' we can keep platform
specific code to minimum. Some people do not like 'system',
but 'system' is supported by all C++ compilers.

Thanks to those who took interest to investigate this problem
-- Ann Fitchard
namtog
2008-04-22 17:00:16 UTC
Permalink
Greetings,

Ann Fitchard wrote:
"This is the first time I am communicating in a group.
If I am not doing things the right or conventional way,
please let me know."

Your doing great.

I downloaded your example files btest1 and btest2.
Both of them can find Blat when it is installed to;

C:\Windows\System32\blat.exe

or in the same folder with btest1.exe.

This is on Vista Basic running as Admin.

Try this. Go to;

C:\Windows\System32\blat.exe

Right click on Blat. Then select Properties. Now
the security tab. In the Permission for SYSTEM
box make sure Allow is checked for;

Full Control

Modify

Read & execute

Read

Write

If your App still can't find Blat click on the
Advanced button and add the above permissions
for what ever group you are logged in as.

Are you sure when you test that you have Admin
status?

Also heard from Ann;
"Since blat is for Windows only. On unix/linux we
have to use 'hmail'."

Blat runs and runs well under Wine. Since Wine
is common on *nix this might simplify things
for you.


Namtog
Fitchard, Ann (PSAF)
2008-04-22 18:20:52 UTC
Permalink
Hello, Namtog,



Per your suggestion, I opened the property page of
C:\windows\system32\blat.exe -

Under the permission tab:

'System' and 'Administrator' have full control, and 'Users' has Read &
Execute control.

Under the effective tab:

For user psaf (that's I), every single box from 'Full Control' to 'Take
Ownership' is checked.



Out of curiosity, I opened the property page of
C:\windows\system32\notepad.exe, and had the two property pages side by
side. I found something interesting -

Under the General tab, in the bottom section, both blat and notepad have
'Attributes...", but blat has something in addition:

Security: This file came from another computer and might be blocked to
help protect this computer. And, a push button "Unblock" is present.



So, I pushed "Unblock". The "Security.." stuff disappeared. Now the
"General" tab page of blat.exe looks just like that of notepad. I fired
up my test again. The same error was returned that "'blat' is not
recognized as an internal or external command, operable program or batch
file..." I re-opened the blat.exe property page. The "Security..." is
on the General tab again. Evidently 'vista' does not let me unblock it.



This "General > Security..." explains why C:\Windows\system32\blat.exe
is not recognized as an executable, but it does not offer me a solution
(since "Unblock" did not work for me). Furthermore it does not explain
why blat.exe works when it is co-located with my test application (in
the same folder). Its property page (General tab) has the same block of
Security declaration.



You may not see that "Security..." mumbo jumbo on your blat.exe property
page, since yours worked. I am uploading a screenshot
(blat-property.bmp). Feel free to delete it after you have seen it. I
hope that I am not cluttering the file system.



Thanks for looking into this. Thank you also for the information on
"Wine". I will check it out on our system.



Ann Fitchard



________________________________

From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of
namtog
Sent: Tuesday, April 22, 2008 12:00 PM
To: ***@yahoogroups.com
Subject: [blat] Re: IB Test



Greetings,

Ann Fitchard wrote:
"This is the first time I am communicating in a group.
If I am not doing things the right or conventional way,
please let me know."

Your doing great.

I downloaded your example files btest1 and btest2.
Both of them can find Blat when it is installed to;

C:\Windows\System32\blat.exe

or in the same folder with btest1.exe.

This is on Vista Basic running as Admin.

Try this. Go to;

C:\Windows\System32\blat.exe

Right click on Blat. Then select Properties. Now
the security tab. In the Permission for SYSTEM
box make sure Allow is checked for;

Full Control

Modify

Read & execute

Read

Write

If your App still can't find Blat click on the
Advanced button and add the above permissions
for what ever group you are logged in as.

Are you sure when you test that you have Admin
status?

Also heard from Ann;
"Since blat is for Windows only. On unix/linux we
have to use 'hmail'."

Blat runs and runs well under Wine. Since Wine
is common on *nix this might simplify things
for you.

Namtog





[Non-text portions of this message have been removed]
namtog
2008-04-22 19:54:41 UTC
Permalink
Greetings,

Ann Fitchard wrote;
"You may not see that "Security..." mumbo jumbo
on your blat.exe property page, since yours worked."

Your right, I don't see the Block button. I even
deleted Blat and downloaded a fresh copy from;

http://blat.net

I did a search for "Vista files unblock" and found
some possible solutions. One that may apply to you.

Is your copy of Vista fully updated? Some of the web
pages I visited claim that this bug was fixed.

Still I wouldn't consider releasing a applications that
installs anything in PATH for Vista. It's far too
rough. Of course you company may not allow the alternative
of keeping everything in Program Folders. Leaving
you with few options.

Thank you very much for bringing this to my attention.

Sorry I couldn't be of help solving this issue.

Namtog
Fitchard, Ann (PSAF)
2008-04-22 20:58:29 UTC
Permalink
Hello, Namtog,



Thank you for the reply. At least we found the problem (I think). I
will take it to Microsoft to get it figured out. If I can get it
resolved, I will post it with the group, since someone else may
encounter this problem with vista.



Thanks to all people who took interest to this problem.



Ann Fitchard







________________________________

From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of
namtog
Sent: Tuesday, April 22, 2008 2:55 PM
To: ***@yahoogroups.com
Subject: [blat] Re: IB Test



Greetings,

Ann Fitchard wrote;
"You may not see that "Security..." mumbo jumbo
on your blat.exe property page, since yours worked."

Your right, I don't see the Block button. I even
deleted Blat and downloaded a fresh copy from;

http://blat.net <http://blat.net>

I did a search for "Vista files unblock" and found
some possible solutions. One that may apply to you.

Is your copy of Vista fully updated? Some of the web
pages I visited claim that this bug was fixed.

Still I wouldn't consider releasing a applications that
installs anything in PATH for Vista. It's far too
rough. Of course you company may not allow the alternative
of keeping everything in Program Folders. Leaving
you with few options.

Thank you very much for bringing this to my attention.

Sorry I couldn't be of help solving this issue.

Namtog





[Non-text portions of this message have been removed]
namtog
2008-04-22 22:03:09 UTC
Permalink
Greetings,

I think at times I'm developing a OCD. I get a bee
in my bonnet and just can't let go.

Here are two solutions. Take Control;

http://www.winmatrix.com/forums/index.php?showtopic=13145

Take Ownership;

http://www.winmatrix.com/forums/index.php?showtopic=13157

Namtog
annfitchard
2008-04-23 22:50:52 UTC
Permalink
I have more information to report, on the subject of invoking blat on
vista from a C++ application.

Evidently C:\windows\system32 is a very special folder (more special
than I thought). The applications disposed in that folder by the user
(even with elevated privilege) behaves differently, or are treated
differently. I used two test applications - btest1 is a simple
application I compiled, which prints "OK" to the console, and notepad2
is just a copy of notepad. In my C++ code, I used 'system' to call
these applications, and I wrote the results in the comments:

system ("C:\\windows\\system32\\btest1.exe"); //returns error

system ("btest1.exe"); //the exe in the local folder works

system ("C:\\windows\\system32\\notepad2"); //the notepad2 in system32
fails to come up

system ("..\\notepad2.exe");//a copy in the parent folder of my C++
calling program works

sprintf (myline, "\"C:/program files (x86)/btest1.exe\"");

system (myline);//a copy in the program file folder works

As you see, I can put my application in C:\program files (x86), which is
too a protected folder, and the application will launch for me. The
only folder (so far) I cannot stick my program (or blat) in is
C:\windows\system32 . Again, this is a problem with Windows/vista and
C++/system function only. I have no problem invoking an application I
put in system 32 folder on Windows XP. Even on vista, I can stick a
program in C:\windows\system32 folder and then double click on the
program. It works. I can call it by the name from a dos command
prompt, with the C:\windows\system32 in my path environment. It works.
The problem occurs only when vista .AND.
C++/system("C:\windows\system32\myApplication.exe").

Ann Fitchard






[Non-text portions of this message have been removed]

Continue reading on narkive:
Loading...