Increasing Windows Mobile 5 Emulator Storage - database

I'm using the Microsoft Sync Framework to synchronize a SQL Server database with a SQL Compact SDF file on the Windows Mobile 5 emulator. We have a 2 gig SD card in the actual device we're deploying on so we'd like to store our database file there. However, when I map a shared folder as the storage card in the Windows Mobile 5 emulator, the SQL Compact engine is not able to create or modify a database file on the mapped storage card because of a bug. So to get past this during development on the emulator, I was just going to store the database on the internal device storage, however, it's limited to 32 MB and I can't find a way to increase it. Does anyone know how to increase the storage space on the emulator. I'm talking storage space not RAM :).
Otherwise, does anyone know how to get past the bug of not being able to have a SQL Compact database file on the storage card in the emulator?
Thanks!

Under http://forum.xda-developers.com/showthread.php?t=549675 you will find a driver for the emulator that sets up a RAM Disk, that for the emulator is seen as an external storage card but doesn't suffer from the issues with mapping a folder. I've checked with SQL Compact sdf file stored in the RAMDisk and it works like a charm. I've used it as a 64MB drive but supposedly it can handle up to 256 MB.

actually you can do this.
First of all open Device Emulator and run the emulator of your choice. In my case i open Windows Mobile 5.0
Then, as it runs, from device emulator, right click the emulator you just run and select Save-As, save it somewhere and then open this file with a text editor.
In there, you will find an option that says memsize, set it the following:
<MemSize Reconfigurable="true">256</MemSize>
Unfortunatly the maximum is 256 as it says if you try to set it higher.
Now, from Device Emulator, select the emulator entry that you just saved previously(Not the original, but the custom located under My Device Emulators in Device Emulator) and will be run with the cfg file that you just modified.
Hope this helps.

If you have an actual device I would recommend testing on the device by connecting it via active sync. I do not know how to change the memory of the emulator but I know that HP has emulators that you can download for testing and I would bet that one of them would match what you are trying to target.

In the Microsoft Device Emulator V3 (note that this installs in and over-writes the previous "\Microsoft Device Emulator\1.0" folder), using Windows Mobile 5, the help you get when typing "deviceemulator" with no parameters is pasted below. The first thing it states is that message about memsize. I tried it with values > 256 MB and just throws up the help dialog box. I was messing with this when trying to get it to recognize my /sharedfolder as a storage card. Maybe this will be possible in newer device emulators. If I can get it to work I can test placing an SDF file on the card.
Device Emulator
Memory size must be a value between 64 and 256.
Command Line Option Help
binfile - Filename of the binfile to be loaded by the emulator.
#responsefile - Filename to XML response file.
/a - Keeps emulator window always on top.
/battery - Emulates running from a battery instead of AC
/batterycharge percentage - Emulated battery charge percentage
/c - Creates and displays a console window to show output from Serial Port 1.
/cpucore - ARMv4 or ARMv5. Default is ARMv4.
/cpuoptions - A combination of (T)humb,D(ebug),I(nternetworking),M (Long Multiply),E (DSP). Of these, T,D,I will always be set.
/defaultsave - Use the VMID as the saved state name and place the saved state file in the per user directory.
/flash filename - Enables flash-memory emulation and specifies flash-memory storage filename.
/h - Sets host-only routing for network packets.
/hostkey keyname - Specifies host key, where keyname can be 'None', 'Left-Alt', or 'Right-Alt'.
/language LangID - Specifies the UI language, where LangID is a decimal.
/memsize size - Sets emulated RAM size, where size is in megabytes.
/nosecurityprompt - Do not prompt when enabling potentially unsafe peripherals when restoring from saved state.
/n [macaddress] - Enables CS8900 network adapter where optional macaddress specifies which host adapter the card will bind to.
/p [macaddress] - Enables NE2000 PCMCIA network adapter, where optional macaddress specifies which host adapter the card will bind to.
/r address - Specifies ROM file base address(in hexadecimal).
/rotate angle - Rotates the display by degrees, where angle can be 0, 90, 180, or 270.
/s filename - Specifies the save-state filename.
/sharedfolder directoryname - Mounts directoryname as a storage card.
/skin filename - Loads the specified skin file.
/tooltips state - Enables or disables tooltips, where state is 'ON' or 'OFF'.
/u0 serialport /u1 serialport /u2 serialport - Maps guest serial ports 0-2 to Windows serial ports.
/vfp - Vector Floating Point coprocessor: true or false. Default is false.
/video xx - Specifies screen size and bit-depth.
/vmid {GUID} - Specifies the VMID GUID.
/vmname name - Specifies the window title.
/z - Zooms the display to 2x normal size.
/speakerphone - {[SpeakerPhone][Headset][Carkit]} - Bitmapped number between 0-7 specifying Speakerphone, Headset, Carkit mode.
OK

Related

How to know whether a particular video file (.mp4) is busy or not?

I have a media server application implemented with the help of Wowza (on Linux, Centos). There are some mp4 files stored in my local directory. I am streaming these files whenever any client requests them. At some point in time, all these files need to be deleted from the local directory, through bash/python script. Before deleting, I need to make sure that no client is accessing the video files. How can I know whether a particular video file is getting streamed or not at the present time?
I have tried the following commands, but no luck.
1) fuser xyz.mp4
2) lsof | grep xyz.mp4
Plz, suggest if you know any other alternative.
This is not an OS-platform solution, but rather implements the built-in HTTPProviders in your Wowza software. If you query the following URL:
http://localhost:8086/connectioncounts?flat
It should return an XML output that lists the stream names currently being played. For example:
<WowzaStreamingEngine>
<Stream vhostName="_defaultVHost_" applicationName="vod" appInstanceName="_definst_" streamName="sample.mp4" sessionsFlash="0" sessionsCupertino="3" sessionsSanJose="0" sessionsSmooth="0" sessionsRTSP="0" sessionsMPEGDash="0" sessionsTotal="3"/>
</WowzaStreamingEngine>
The above output shows that sample.mp4 is currently being played. The ?flat option simplifies the output. You would then only need to parse the streamnames.

Virtual Audio Cable .bat file output/input device language error

I've been trying to set up a .bat file for launching my Virtual Audio Cable setup for easy use. It turned out to be more troublesome than first expected.
The special characters "ÆØÅ" that is found on my device names are messing up with the VAC application.
My .bat file looks as such:
chcp 1252
start /min "audiorepeater" "D:\Programmer\Virtual Audio Cable\audiorepeater.exe" /Input: "Mikrofon på headset (8-Logitec" /Output: "Line 1 (Virtual Audio Cable)" /BufferMs: 50 /Buffers: 8 /Autostart
start /min "audiorepeater" "D:\Programmer\Virtual Audio Cable\audiorepeater.exe" /Input: "Stereomix (2- Realtek High Defi" /Output: "Line 1 (Virtual Audio Cable)" /BufferMs: 50 /Buffers: 8 /Autostart
start /min "audiorepeater" "D:\Programmer\Virtual Audio Cable\audiorepeater.exe" /Input: "Stereomix (2- Realtek High Defi" /Output: "Øresnegl på headset (8-Logitec" /BufferMs: 50 /Buffers: 8 /Autostart
The Stereomix -> Line 1 works fine. The others bug out, even though I finally after hours of research managed to get it to treat "ÆØÅ" correctly (Is shown in the error message).
The error message now reads: "No output device "Øresnegl på headset (8-Logitec"" even though that's the exact name of the output device in the list.
It's saved as "All files" and ANSI. Also tried messing with it in notepad++. No luck.
Im at a loss on how to make VAC recognize the name correctly, it seems to be a codepage incompatibility.
Thanks,
lindenkron
Go to your recording devices and change the name. Make it something else. It doesn't end with (8-Logitec) its much longer u you just can't see it.
Simply rename the device and then edit your .bat and save it out as .bat

Detect that a file has been copied to another thumb drive

I need to detect that a file has been copied from one thumb drive to another. The programming Language is VBA (WWB-COM) on a Win CE machine. In order to do so, I need to look at what could possibly change.
So far I have tried with these options:
USB Disk name: another disk will have a different name, so I know it's not the original USB stick. This works fine on normal systems, but in CE 6.0 the usb drive is renamed to "Hard Disk2".
Date file modified: this value is not changed if I copy the file from one disk to another. The only value changed is "Date file created" but this is not accessible without using FSO, which is not available on CE 6.0.
What could be something I can check through VBA that tells me that the file is not the one I am expecting?
--------ADDITIONAL INFORMATION---------
since this sticks use non-standard disk size, an option would be to retrive the size of "Hard disk2". but i was not able to find out how to do it..
here is the reference to all comands: http://www.winwrap.com/web/basic/language/?p=doc_group_overview.htm&menu=yes

Number optical disc drives in C like drutil does for OS X command line

Optical disc device names (examle: /dev/disk4) are a bit weird on Mac OS X. Unlike on other OSs, they belong to the mounted media, not the drive so only exist when a disc is inserted. Additionally they are in no term stable. They can change already when anoter .dmg file is mounted before the next disc is inserted into the drive. On Windows drive letters are stable and linux has device names like /dev/cdrom or /dev/sr0 which are quite stable. Changes in hard discs, usb drives and packages have no effect on optical device names there.
I develop a C library working with audio CDs and would like to use the drive numbering exposed by drutil from C.
drutil list lists all drives connected to the machine (with or without disc and gives them numbers.
With drutil details -drive 1 I can then get the details for the first drive, including the (BSD) device name when a disc is in the drive.
This would be perfect to set a prefered drive in the configuration or similar.
In C I wasn't able to list or index the drives without discs. So when I get the first inserted disc I don't know which drive this disc belongs to.
I can get device names for inserted discs with the IOCDMediaClass.
I do get a one drive listed with the IOCDBlockStorageDeviceClass (with or without a disc inserted), but I can't access the device name even when a disc is in the drive.
I prepared some example code that tries to list members of both classes and the device name if available.
The output without a disc in the drive:
detected media:
detected CD block devices:
drive 1:
class name: IODVDServices
The output with a disc in the drive:
detected media:
drive 1:
device name: disk4
class name: IOCDMedia
detected CD block devices:
drive 1:
class name: IODVDServices
PS:
I know I can call drutil from C, but that would be a last resort.
I found the information attached to IODVDServices using ioreg -r -c IODVDServices (ioreg).
The corresponding registry entry has (grand)children of which one is of type IODVDMedia when no CD is in the drive and of type IOCDMedia when an audio disc is in the drive (including the device name when a disc is inserted).
These children can be accessed with IORegistryEntryCreateIterator() and tested for being a certain class with IOObjectConformsTo():
static io_object_t get_media(io_object_t storageDevice)
{
io_iterator_t childrenIterator;
io_object_t nextChild;
io_object_t mediaObject = 0;
IORegistryEntryCreateIterator(storageDevice,
kIOServicePlane, kIORegistryIterateRecursively,
&childrenIterator);
while ((nextChild = IOIteratorNext(childrenIterator))) {
if (IOObjectConformsTo(nextChild, kIOCDMediaClass))
mediaObject = nextChild;
else
IOObjectRelease(nextChild);
}
IOObjectRelease(childrenIterator);
return mediaObject;
}
I pushed a complete solution to gist.
This tries to find a mounted media attached to a specific drive of IOCDBlockStorageDeviceClass. Finding the device name of that media works the same as specified in the question and the CDROMSample provided by Apple.
EDIT:
You can also just take any BSD name in one of the (recursive) children with IORegistryEntrySearchCFProperty. There shouldn't be other children with device names and this saves you the additional iteration.
deviceFilePathAsCFString = IORegistryEntrySearchCFProperty(storageDevice,
kIOServicePlane, CFSTR(kIOBSDNameKey),
kCFAllocatorDefault, kIORegistryIterateRecursively);
This is used in the implementation for libdiscid.

Filesystem links on a FAT32 formatted storage

I know FAT32, as well as FAT16/12 neither support symbolic links nor hard-links. However I came up with this idea:
The FAT specification describes that every file is associated with a directory-entry. In my understanding, one could say that a file-entry in a directory somehow or other points to the file's content.
So, how can I define two directory-entries which point to the same file-content? Or, what could prevent me from doing so?
Use case: I have a USB mass storage device for my car radio, and I want to use directories as playlists since the radio software doesn't support playlists. So it isn't important to me how Windows behaves when doing this.
This should work for simple issues. I.e. it works as a hack / workaround and I don't know what happens if you rename / move / remove files. So, you should not do this on your main hdd.
I edited the directory-entries manually using a hex editor. I modified clusters as well as file-sizes and successfully faked hardlinks. My car-radio and even Windows (7, 64Bit) have no problems with playing back the original and "hard-linked" mp3-Files I used.
When I'm opening the device again in the hex-editor none of my modifications are changed back (See chkdsk issue in answer #1 - but as far as I know chkdsk has to be started manually, anyways.
What you are talking about ("two directory-entries which are pointing to the same file-content") are hard links. chkdsk will report them as cross-links and break them, "repairing" the files (in fact making the copies).
MichaelPh posted instructions on SuperUser:
https://superuser.com/a/486829/51237
It's possible to use Disk Probe (on XP only, I've yet to get it to write the changes on Win7) to modify the cluster a FAT Directory references. This method can be used to redirect the DCIM folder (or a subfolder) to point to the folder used by a different scan device.
Whether this is a good idea or not is a different matter and you use this at your own risk.
Insert the Eye-Fi card either in it's USB Card Reader or directly into an SSD slot and note the drive letter it's installed as (assumed to be F:\ for simplicity)
Ensure all Windows Explorer windows for the card and sub-directories are closed.
Run Disk Probe
Select Drives->Logical Volume
In the Open Logical Volume dialog double-click F:\ in the Logical Volumes list
Click the Set Active button for the Handle F: has been selected as. You can leave the handle as read-only for now.
Select Tools->Search Sectors...
Check Exhaustive Search, enter DCIM in Enter characters to search for and Search
You should find a match (mine is at 8192). Select No on the "Found match..." dialog to cancel the rest of the search.
Select Sectors->Read and increase Number of Sectors to at least two so that the whole directory table is included.
Find DCIM in the ASCII on the right of the Disk Probe screen, this is the start of the FAT entry for the directory. Make a note of the hex value of the 27th byte of the record (each entry is 32bytes), this is the directory cluster reference. This value is require to revert the DCIM directory back to normal use if required.
Find the entry for the directory you want to redirect DCIM to and again make a note of the 27th byte in the record.
Go back to the 27th byte of the DCIM record and change it to the value noted in step 11.
Select Sectors->Write and then click Write it on the Write Sector dialog. A warning will come up if you opened the sectors as read-only. Yes to overwrite if you're happy to make the change.
Opening the DCIM directory in Windows Explorer will now show the contents of the target directory.

Resources