Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Saturday, 16 February 2013

Debug a x86 WCF Service on a x64 Platform

The Windows Communication Foundation (WCF), previously known as "Indigo", is a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications. [Wikipedia]

This issue was occurred on my previous assignment.
In that assignment, I need to create a WCF Service Library. For maximal compatible, I set the platform as x86.


After some coding works,I launched the debugger...
But there was an exception:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\celeron533\Dropbox\5041\Assignment2_Project\Airline2_Server\AirLineServiceLibrary\bin\x86\Debug\AirLineServiceLibrary.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.


The reason is, Service Library is a DLL file and need a program to host and call it. In Visual Studio 2010, this host program is:
Microsoft Visual Studio 10.0\Common7\IDE\WcfSvcHost.exe
When installing the VS2010, install wizard detected that the system is x64 so it copy the x64 version of WcfSvcHost.exe
However, as the message box indicated, this x64 service host could not load and run x86 service DLLs.

Solution (from msdn):
http://social.msdn.microsoft.com/Forums/en/wcf/thread/2e29a4aa-e587-43ef-bf50-329b7cd3eefb



  1. Copy WcfSvcHost.exe from C:\program files (x86)\Microsoft Visual Studio 9.0\Common7\IDE to a local directory. Keep a backup copy of this file, of course.
  2. Start a Visual Studio 2008 Command Prompt (one of the links from the start menu -> Visaul Studio 2008)
  3. "cd" to the directory where your copy of WcfSvcHost is located.
  4. Execute the command "corflags /32BIT+ /FORCE WcfSvcHost.exe"
  5. Copy the exe back to where you found it.




Now it works!

After a Netbook dropped down (screen and HDD)

This netbook, from my friend, dropped from the table. The screen cracked and seems always auto-reboot.

Samsung NP-NC10, Intel Atom Netbook
Atom N270 1.6GHz
Intel 945GSE+ICH7-M
1GB DDR2
160G
10.2 inch LED backlight
1024 x 600




Firstly, disassemble the plastic framework.

Separate the LCD panel.

Now we can see the LCD model number and bar code.
Model: BA96-04004A
However, there is only 10 results on Google (maybe Samsung internal model) and all of them are located in Europe, €250 EUR. So far and expensive.



No problem, we could connect external monitor and install Everest AIDA to check the real screen model.
BUT.....
The system could not boot to Windows. Always auto-reboot. No response on Ctrl-Alt-Del. HDD damaged??

Plan B. Switch the HDD to my own laptop, in order to check the HDD and install the new Windows.
Netbook(back)

FUJITSU


My notebook (ASUS)



Check the HDD, all green, no damage. Good.
The reason of infinite rebooting is "windows is missing boot file".
Backup, format and re-install Windows.

[Important] During Windows installation, there is an auto reboot. Before this reboot, the setup.exe restore the *.wim dump file to target HDD partition. After reboot the system, setup will continue but this time, start configuration based on the hardware.

So I need to switch the HDD back to Samsung netbook when the first reboot occurs. Otherwise, the Windows will configured as the hardware of my laptop, nor Samsung. Wrong hardware configuration will lead to BSOD.

After install Windows, I could use external monitor.

Finally, got the real model:
Chunghua CLAA102NA0A
Chunghua CLAA102NA0A

Go eBay and make an order.

Friday, 15 February 2013

HOWTO: install Oracle 10g on Windows 7 x64

There WAS a possible solution on this issue: Run the Installation Guide in Compatibility Mode. However, it only works on Windows 7 x86. On x64 OS, JVM would freeze or crash,interrupt the installation.



This post will present a satisfied solution on this issue.

Go to Oracle website and download the database (10g is no longer available on this page now, but could be downloaded from Oracle ftp)
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

Oracle Database 10g Release 2 (10.2.0.4) for Microsoft Windows Vista x64, Microsoft Windows Server 2008 R2 x64, Windows 7 x64

Unfortunately, you still could not launch Oracle Universal Installer due to mismatch OS version.
Checking installer requirements...
Checking operating system, must be 5.0, 5.1, 5.2 or 6.0 Actual 6.1
Failure. 

"What?! It supports Win7 x64 in the description."

I believe this is a stupid mistake from Oracle, Windows Vista is version 6.0 and Windows 7 is 6.1.

We could get over this problem by set the installer "ignore checking requirements", just add a startup parameter after installer.exe
-ignoreSysPrereqs






NOTE: you need to tick on "check operating system requirements" manually!
Otherwise, you will not to next step.







Play non-English version WarCraft on an English Windows7

Windows 7 x64 English

One of my friends called me that he has trouble in playing the WarCraft on his system. He bought the laptop in Australia, pre-installed the Windows 7 English language version. However, when he wanted to launch the game, something went wrong:

"WC3 required specific version of Windows"

The source of this issue is that Blizzard implemented a system locale check. If the game locale and the system locale are not equal, WarCraft will load extra language pack.

Luckily, some experts (or hackers?) on the network provided an possible solution: modify the game DLL(Dynamic Link Library).

That "Game.dll" file is normally located in the root folder of the game, you can easily figure it out.

Then, use some Hex editor to edit the file. You could use WinHex, UltraEdit, or
Notepad++ with Hex plugin.

Just copy "HexEditor.dll" to //notepad++//plugins folder ,it will take effect.


Launch notepad++, and open Game.dll (Remember BACKUP the original file!)
then
click the menu bar: plugin -> HEX Editor -> View in HEX


Search string:
3D04080000742A3D04


Modify the 74 to EB, then save the file.


ALL DONE! Enjoy the game.



======================= Other issues ==================================

"I am using gForce 310M, but the game does not run as smooth as it does in the Windows XP"

WC3 runs on DirectX 8.1 while Windows only capacity with DX9 and DX10. Convert operations slow the fps and heavy the CPU's workload.
It is better to switch the game 3D render engine into OpenGL mode to optimize the performance.
Create a new shortcut of the game and add some startup parameter after it:
" -opengl"
Please note that there is an initial space.
Now it should looks like:
"D:\WarCraftIII\" -opengl
Sometimes, activate the shadow effects (under OpenGL) will crash the game.



--------------

"I have a FullHD screen, but the game only supports 1024x768 resolution"

Run "regedit"
Expand the brunch
HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Video

modify the value:
resheight 640 
reswidth 480
to your resolution.