It appears to be an Afghan tribal long gun (jezail). Sometimes these guns had a two-prong bipod that rotated forward on the forearm. The curved stock, termed 'Limak', is typical of the jezail. People often imagine that these stocks were shaped to be tucked under the arm for shooting, but the Afghan tribals were - and are - excellent marksmen, and these guns were shouldered and aimed as we would a rifle.
Jezails were originally matchlocks, but during the 19th century many were refitted with flintlocks, with the locks frequently salvaged from East India Company arms - the most common lock seen is from the EICo 'Windus's pattern' musket, the basis for the India Pattern 'Brown Bess'. Your lock appears to be from a British Ordnance post-1809 India Pattern, but that's not uncommon either - by the 1840s there were plenty of British as well as EICo troops in northern India. It's thought that a large number of locks were salvaged from arms discarded by the ill-fated 'Army of the Indus', annihilated as they tried to escape to India during the First Afghan War in 1842.
Plenty of jezails have come back over the years with British soldiers, and now again with the recent involvement in Afghanistan. A lot of the stuff coming recently from Afghanistan is pretty suspect - some very skilled gunsmiths in Kabul etc who have generations of experience copying and putting together arms for actual use, and now do it for 'tourists'. Some of these guns are built around genuine old parts. My impression though is that yours has more of an authentic ring about it - the lock looks real and the stock looks genuine too, with plausible wear at the butt and around the lock. Even the brass on the forestock could be genuine. But it's very hard to tell for sure without handling these things. An interesting piece!